| 461 | } |
| 462 | |
| 463 | inline 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 |
no outgoing calls
no test coverage detected