| 93 | } |
| 94 | |
| 95 | ImageBatchVarShape EraseVarShape(ImageBatchVarShape &input, Tensor &anchor, Tensor &erasing, Tensor &values, |
| 96 | Tensor &imgIdx, bool random, unsigned int seed, std::optional<Stream> pstream) |
| 97 | { |
| 98 | ImageBatchVarShape output = ImageBatchVarShape::Create(input.numImages()); |
| 99 | |
| 100 | auto format = input.uniqueFormat(); |
| 101 | if (!format) |
| 102 | { |
| 103 | throw std::runtime_error("All images in input must have the same format."); |
| 104 | } |
| 105 | |
| 106 | for (auto img = input.begin(); img != input.end(); ++img) |
| 107 | { |
| 108 | auto newimg = Image::Create(img->size(), format); |
| 109 | output.pushBack(newimg); |
| 110 | } |
| 111 | |
| 112 | return EraseVarShapeInto(output, input, anchor, erasing, values, imgIdx, random, seed, pstream); |
| 113 | } |
| 114 | |
| 115 | } // namespace |
| 116 |
nothing calls this directly
no test coverage detected