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

Function MinMaxLoc

python/mod_cvcuda/operators/OpMinMaxLoc.cpp:235–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234template<class InputContainer>
235TupleTensor6 MinMaxLoc(InputContainer &input, nvcv::DataType inDataType, int numSamples, int maxLocs,
236 std::optional<Stream> pstream)
237{
238 // Row align must be 1 in below tensors so last 2 dimensions are packed
239
240 // clang-format off
241
242 Tensor minVal = Tensor::Create({{numSamples, 1}, "NC"}, GetValDataType(inDataType), 1);
243 Tensor minLoc = Tensor::Create({{numSamples, maxLocs, 2}, "NMC"}, nvcv::TYPE_S32, 1);
244 Tensor numMin = Tensor::Create({{numSamples, 1}, "NC"}, nvcv::TYPE_S32, 1);
245 Tensor maxVal = Tensor::Create({{numSamples, 1}, "NC"}, GetValDataType(inDataType), 1);
246 Tensor maxLoc = Tensor::Create({{numSamples, maxLocs, 2}, "NMC"}, nvcv::TYPE_S32, 1);
247 Tensor numMax = Tensor::Create({{numSamples, 1}, "NC"}, nvcv::TYPE_S32, 1);
248
249 // clang-format on
250
251 return MinMaxLocInto(minVal, minLoc, numMin, maxVal, maxLoc, numMax, input, pstream);
252}
253
254TupleTensor6 MinMaxLocTensor(Tensor &input, int maxLocs, std::optional<Stream> pstream)
255{

Callers 2

MinMaxLocTensorFunction · 0.70
MinMaxLocVarShapeFunction · 0.70

Calls 2

MinMaxLocIntoFunction · 0.85
GetValDataTypeFunction · 0.70

Tested by

no test coverage detected