| 38 | } |
| 39 | |
| 40 | inline ImageBatchVarShape batchLike(ImageBatchVarShape &src) |
| 41 | { |
| 42 | ImageBatchVarShape dst = ImageBatchVarShape::Create(src.capacity()); |
| 43 | for (int i = 0; i < src.numImages(); ++i) |
| 44 | { |
| 45 | dst.pushBack(Image::Create(src[i].size(), src[i].format())); |
| 46 | } |
| 47 | return dst; |
| 48 | } |
| 49 | |
| 50 | template<typename Op, typename Src, typename Dst, typename Call> |
| 51 | auto runGuard(Op &op, Src &src, Dst &dst, const Tensor &twist, std::optional<Stream> &pstream, Call &&call) |