| 89 | } |
| 90 | |
| 91 | std::string TensorShape::to_string() const { |
| 92 | std::ostringstream out; |
| 93 | out << "["; |
| 94 | for (size_t i = 0; i < rank; ++i) { |
| 95 | if (i > 0) { |
| 96 | out << ", "; |
| 97 | } |
| 98 | out << dims[i]; |
| 99 | } |
| 100 | out << "]"; |
| 101 | return out.str(); |
| 102 | } |
| 103 | |
| 104 | bool TensorValue::valid() const noexcept { |
| 105 | return tensor != nullptr && shape.rank > 0; |