| 78 | } |
| 79 | |
| 80 | ImageBatchVarShape ThresholdVarShape(ImageBatchVarShape &input, Tensor &thresh, Tensor &maxval, uint32_t type, |
| 81 | std::optional<Stream> pstream) |
| 82 | { |
| 83 | ImageBatchVarShape output = ImageBatchVarShape::Create(input.numImages()); |
| 84 | |
| 85 | auto format = input.uniqueFormat(); |
| 86 | if (!format) |
| 87 | { |
| 88 | throw std::runtime_error("All images in input must have the same format."); |
| 89 | } |
| 90 | |
| 91 | for (auto img = input.begin(); img != input.end(); ++img) |
| 92 | { |
| 93 | auto newimg = Image::Create(img->size(), format); |
| 94 | output.pushBack(newimg); |
| 95 | } |
| 96 | |
| 97 | return ThresholdVarShapeInto(output, input, thresh, maxval, type, pstream); |
| 98 | } |
| 99 | |
| 100 | } // namespace |
| 101 |
nothing calls this directly
no test coverage detected