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

Function StackInto

python/mod_cvcuda/operators/OpStack.cpp:96–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96Tensor StackInto(Tensor &output, std::vector<Tensor> &tensorList, std::optional<Stream> pstream)
97{
98 int64_t outputShape[4] = {}; // NCHW/NHWC
99 nvcv::TensorLayout layout = nvcv::TENSOR_CHW;
100 nvcv::DataType dtype;
101
102 checkTensorList(tensorList, outputShape, layout, dtype);
103
104 if (output.shape().layout() != nvcv::TENSOR_NCHW && output.shape().layout() != nvcv::TENSOR_NHWC)
105 throw std::runtime_error("Invalid output tensor shape");
106
107 if (output.shape()[0] != outputShape[0])
108 throw std::runtime_error("Invalid output tensor shape");
109
110 StackIntoInternal(output, tensorList, pstream, outputShape[0]);
111 return std::move(output);
112}
113
114Tensor Stack(std::vector<Tensor> &tensorList, std::optional<Stream> pstream)
115{

Callers

nothing calls this directly

Calls 4

checkTensorListFunction · 0.85
StackIntoInternalFunction · 0.85
layoutMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected