| 517 | } |
| 518 | |
| 519 | TensorBatch TensorBatchHQResize(TensorBatch &src, const std::vector<Shape> &outShape, std::optional<bool> antialias, |
| 520 | const std::optional<Rois> &roi, std::optional<NVCVInterpolationType> interpolation, |
| 521 | std::optional<NVCVInterpolationType> minInterpolation, |
| 522 | std::optional<NVCVInterpolationType> magInterpolation, std::optional<Stream> pstream) |
| 523 | { |
| 524 | TensorBatch out = TensorBatch::Create(src.numTensors()); |
| 525 | |
| 526 | int32_t numOutSizes = outShape.size(); |
| 527 | if (numOutSizes != src.numTensors() && numOutSizes != 1) |
| 528 | { |
| 529 | throw std::runtime_error( |
| 530 | "The list of output shapes `out_size` must either contain a single shape to be used for all output tensors " |
| 531 | "or its length must match the number of input tensors."); |
| 532 | } |
| 533 | |
| 534 | for (int i = 0; i < src.numTensors(); ++i) |
| 535 | { |
| 536 | auto sampleShape = outShape[numOutSizes == 1 ? 0 : i]; |
| 537 | const auto &inSample = src[i]; |
| 538 | auto resizedShape = ResizedTensorShape(inSample.layout(), inSample.shape(), sampleShape); |
| 539 | Tensor dst = Tensor::Create(resizedShape, src.dtype(), src.layout()); |
| 540 | out.pushBack(dst); |
| 541 | } |
| 542 | |
| 543 | return TensorBatchHQResizeInto(out, src, antialias, roi, interpolation, minInterpolation, magInterpolation, |
| 544 | pstream); |
| 545 | } |
| 546 | |
| 547 | } // namespace |
| 548 |
nothing calls this directly
no test coverage detected