MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / apply

Method apply

mlx/data/op/KeyTransform.cpp:14–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 : ikey_(ikey), okey_(okey) {};
13
14Sample KeyTransformOp::apply(const Sample& sample) const {
15 auto src = sample::check_key(sample, ikey_, ArrayType::Any);
16 auto dst = apply_key(src);
17 auto res = sample;
18 auto okey = (okey_.empty() ? ikey_ : okey_);
19 res[okey] = dst;
20 return res;
21}
22
23KeyTransform::KeyTransform(
24 const std::string& ikey,

Callers

nothing calls this directly

Calls 1

check_keyFunction · 0.85

Tested by

no test coverage detected