MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / size

Function size

python/src/utils.cpp:34–47  ·  view source on GitHub ↗

Returns the size in bytes of the specified data type.

Source from the content-addressed store, hash-verified

32
33// Returns the size in bytes of the specified data type.
34size_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.
50py::dtype nptype(nvinfer1::DataType type)

Callers 2

bindFoundationalTypesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected