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

Function TensorShape

python/mod_cvcuda/operators/OpHQResize.cpp:139–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137};
138
139inline HQResizeTensorShapeI TensorShape(const nvcv::TensorLayout &layout, const nvcv::TensorShape &shape,
140 int resizeNDim)
141{
142 assert(resizeNDim == 2 || resizeNDim == 3);
143
144 char shapeArgLayout[4] = "DHW";
145 HQResizeTensorShapeI tensorShape;
146 for (int d = 0; d < resizeNDim; d++)
147 {
148 int axis = layout.find(shapeArgLayout[d + 3 - resizeNDim]);
149 if (axis < 0)
150 {
151 throw std::runtime_error(
152 "The layout of an input tensor to the resize operator must contain HW extents in the layout (for "
153 "images) or DHW extents (for 3D resampling). Some extents are missing in the input tensor.");
154 }
155 tensorShape.extent[d] = shape[axis];
156 }
157 int channelAxis = layout.find('C');
158 tensorShape.numChannels = channelAxis < 0 ? 1 : shape[channelAxis];
159 tensorShape.ndim = resizeNDim;
160 return tensorShape;
161}
162
163class BatchShapesHelper
164{

Callers 10

HistogramFunction · 0.70
BatchShapesHelperMethod · 0.70
submitMethod · 0.70
GetOutputTensorShapeFunction · 0.50
KeyMethod · 0.50
CAPI.cppFile · 0.50
ExtractBufferImageInfoFunction · 0.50
cpuMethod · 0.50
CreateNVCVTensorShapeFunction · 0.50

Calls 1

findMethod · 0.80

Tested by

no test coverage detected