| 1021 | } |
| 1022 | |
| 1023 | size_t Tensor::TotalBytes() const { |
| 1024 | if (shape_.num_elements() == 0) return 0; |
| 1025 | CHECK(buf_) << "null buf_ with non-zero shape size " << shape_.num_elements(); |
| 1026 | CASES(dtype(), return Helper<T>::TotalBytes(buf_, shape_.num_elements())); |
| 1027 | return 0; // Makes compiler happy. |
| 1028 | } |
| 1029 | |
| 1030 | size_t Tensor::AllocatedBytes() const { |
| 1031 | if (buf_) { |