| 459 | } |
| 460 | |
| 461 | float TensorInfo::GetQuantizationScale() const |
| 462 | { |
| 463 | if (m_Quantization.m_Scales.empty()) |
| 464 | { |
| 465 | // NOTE: old default for backward compatibility |
| 466 | return 1.0f; |
| 467 | } |
| 468 | |
| 469 | if (HasMultipleQuantizationScales()) |
| 470 | { |
| 471 | throw RuntimeException("Invalid call to GetQuantizationScale on a tensor with multiple scale values. Use " |
| 472 | "GetQuantizationScales instead."); |
| 473 | } |
| 474 | return m_Quantization.m_Scales[0]; |
| 475 | } |
| 476 | |
| 477 | void TensorInfo::SetQuantizationScale(float scale) |
| 478 | { |