Equality function for MklDnnShape objects @return true if both are equal; false otherwise.
| 282 | /// Equality function for MklDnnShape objects |
| 283 | /// @return true if both are equal; false otherwise. |
| 284 | inline bool operator==(const MklDnnShape& input_shape) const { |
| 285 | if (this->IsMklTensor() != input_shape.IsMklTensor()) { |
| 286 | return false; |
| 287 | } |
| 288 | |
| 289 | // If input tensors are in OneDNN layout, then we check for dimensions and |
| 290 | // sizes. |
| 291 | if (this->IsMklTensor()) { |
| 292 | const dnnl_memory_desc_t& cur_md = (this->GetMklLayout()).data; |
| 293 | const dnnl_memory_desc_t& input_shape_md = |
| 294 | input_shape.GetMklLayout().data; |
| 295 | return this->GetTfShape() == input_shape.GetTfShape() && |
| 296 | dnnl_memory_desc_equal(&cur_md, &input_shape_md); |
| 297 | } |
| 298 | |
| 299 | // Both inputs are not OneDNN tensors. |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | /// Equality operator for MklDnnShape and TFShape. |
| 304 | /// Returns: true if TF shapes for both are the same, false otherwise |
nothing calls this directly
no test coverage detected