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

Function fieldTypeToDataType

plugin/common/bertCommon.h:463–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463inline nvinfer1::DataType fieldTypeToDataType(const nvinfer1::PluginFieldType ftype)
464{
465 switch (ftype)
466 {
467 case nvinfer1::PluginFieldType::kFLOAT32:
468 {
469 BERT_DEBUG_MSG("PluginFieldType is Float32");
470 return nvinfer1::DataType::kFLOAT;
471 }
472 case nvinfer1::PluginFieldType::kFLOAT16:
473 {
474 BERT_DEBUG_MSG("PluginFieldType is Float16");
475 return nvinfer1::DataType::kHALF;
476 }
477 case nvinfer1::PluginFieldType::kINT32:
478 {
479 BERT_DEBUG_MSG("PluginFieldType is Int32");
480 return nvinfer1::DataType::kINT32;
481 }
482 case nvinfer1::PluginFieldType::kINT8:
483 {
484 BERT_DEBUG_MSG("PluginFieldType is Int8");
485 return nvinfer1::DataType::kINT8;
486 }
487 default: throw std::invalid_argument("No corresponding datatype for plugin field type");
488 }
489}
490
491} // namespace bert
492} // namespace plugin

Callers 6

createPluginMethod · 0.85
createPluginMethod · 0.85
initializeFieldsFunction · 0.85
buildBetaAndGammaFunction · 0.85
createPluginMethod · 0.85
createPluginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected