MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / operator==

Method operator==

tensorflow/core/util/mkl_util.h:284–301  ·  view source on GitHub ↗

Equality function for MklDnnShape objects @return true if both are equal; false otherwise.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

IsMklTensorMethod · 0.95
GetMklLayoutMethod · 0.95
GetTfShapeMethod · 0.95

Tested by

no test coverage detected