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

Method ImageChannelReduction

mlx/data/op/ImageTransform.cpp:402–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400};
401
402ImageChannelReduction::ImageChannelReduction(
403 const std::string& ikey,
404 std::string preset,
405 const std::string& okey)
406 : ImageTransformOp(ikey, okey) {
407 auto settings = IMAGE_CHANNEL_REDUCTION_PRESETS.find(preset);
408
409 if (settings == IMAGE_CHANNEL_REDUCTION_PRESETS.end()) {
410 throw std::runtime_error(
411 std::string("ImageChannelReduction: unable to find preset ") + preset);
412 }
413
414 this->bias_ = settings->second.bias;
415 memcpy(this->m_, settings->second.m, sizeof(this->m_));
416}
417
418std::shared_ptr<Array> ImageChannelReduction::apply_image(
419 const std::shared_ptr<const Array>& image) const {

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected