Operator to compare two TensorDescriptor * * @param[in] other The instance to compare against * * @return True if two instances have the same shape and data type */
| 546 | * @return True if two instances have the same shape and data type |
| 547 | */ |
| 548 | bool operator==(const TensorDescriptor &other) |
| 549 | { |
| 550 | bool is_same = true; |
| 551 | |
| 552 | is_same &= _data_type == other._data_type; |
| 553 | is_same &= _shape.size() == other._shape.size(); |
| 554 | |
| 555 | if (is_same) |
| 556 | { |
| 557 | for (uint32_t d = 0; d < _shape.size(); ++d) |
| 558 | { |
| 559 | is_same &= _shape[d] == other._shape[d]; |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | return is_same; |
| 564 | } |
| 565 | |
| 566 | private: |
| 567 | std::vector<int32_t> _shape{}; |