| 62 | } |
| 63 | |
| 64 | Tensor 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 |
nothing calls this directly
no test coverage detected