Returns the size in bytes of the specified data type.
| 32 | |
| 33 | // Returns the size in bytes of the specified data type. |
| 34 | size_t size(nvinfer1::DataType type) |
| 35 | { |
| 36 | switch (type) |
| 37 | { |
| 38 | case nvinfer1::DataType::kFLOAT: return 4; |
| 39 | case nvinfer1::DataType::kHALF: return 2; |
| 40 | case nvinfer1::DataType::kINT8: return 1; |
| 41 | case nvinfer1::DataType::kINT32: return 4; |
| 42 | case nvinfer1::DataType::kBOOL: return 1; |
| 43 | case nvinfer1::DataType::kUINT8: return 1; |
| 44 | case nvinfer1::DataType::kFP8: return 1; |
| 45 | } |
| 46 | return -1; |
| 47 | } |
| 48 | |
| 49 | // Converts a TRT datatype to its corresponding numpy dtype. |
| 50 | py::dtype nptype(nvinfer1::DataType type) |
no outgoing calls
no test coverage detected