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

Method GetTfLayout

tensorflow/core/util/mkl_util.h:461–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459 }
460
461 inline const memory::desc GetTfLayout() const {
462 memory::dims dims;
463 for (size_t ii = 0; ii < data_.dimension_; ++ii) {
464 dims.push_back(data_.sizes_[ii]);
465 }
466
467 // Create Blocked memory desc if input TF format was set like that.
468 if (data_.tf_data_format_ == MklTensorFormat::FORMAT_BLOCKED) {
469 auto strides = CalculateTFStrides(dims);
470 dnnl_memory_desc_t blocked_md;
471 TF_CHECK_OK(
472 CreateBlockedMemDescHelper(dims, strides, data_.T_, &blocked_md));
473 return memory::desc(blocked_md);
474 } else {
475 auto format_tag =
476 MklTensorFormatToMklDnnDataFormat(data_.tf_data_format_);
477 DCHECK_NE(format_tag, memory::format_tag::undef);
478 return memory::desc(dims, data_.T_, format_tag);
479 }
480 }
481
482 inline const memory::desc GetCurLayout() const {
483 return IsMklTensor() ? GetMklLayout() : GetTfLayout();

Callers 6

ComputeMethod · 0.80
ComputeMethod · 0.80
ComputeMethod · 0.80
ConvertMklToTfMethod · 0.80
ComputeMethod · 0.80
ConvertMklToTFFunction · 0.80

Calls 4

CalculateTFStridesFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected