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

Function Histogram

python/mod_cvcuda/operators/OpHistogram.cpp:64–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64Tensor Histogram(Tensor &input, std::optional<Tensor> mask, std::optional<Stream> pstream)
65{
66 ssize_t shape[3];
67 // check for non batched tensors
68 if (input.shape().size() == 3)
69 {
70 shape[0] = 1;
71 shape[1] = 256;
72 shape[2] = 1;
73 }
74 else if (input.shape().size() == 4)
75 {
76 shape[0] = input.shape()[0];
77 shape[1] = 256;
78 shape[2] = 1;
79 }
80 else
81 {
82 throw std::invalid_argument("Input tensor must be HWC or NHWC");
83 }
84
85 Tensor histogram = Tensor::Create(nvcv::TensorShape(shape, 3, nvcv::TENSOR_HWC), nvcv::TYPE_S32);
86 return HistogramInto(histogram, input, mask, pstream);
87}
88
89} // namespace
90

Callers

nothing calls this directly

Calls 4

HistogramIntoFunction · 0.85
TensorShapeFunction · 0.70
sizeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected