MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / TensorBatchHQResize

Function TensorBatchHQResize

python/mod_cvcuda/operators/OpHQResize.cpp:519–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519TensorBatch 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

Callers

nothing calls this directly

Calls 8

ResizedTensorShapeFunction · 0.85
TensorBatchHQResizeIntoFunction · 0.85
numTensorsMethod · 0.45
sizeMethod · 0.45
layoutMethod · 0.45
shapeMethod · 0.45
dtypeMethod · 0.45
pushBackMethod · 0.45

Tested by

no test coverage detected