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

Function DataIndexToMetaDataIndex

tensorflow/core/graph/mkl_graph_util.h:52–62  ·  view source on GitHub ↗

Get index of MetaData tensor from index 'n' of Data tensor.

Source from the content-addressed store, hash-verified

50
51// Get index of MetaData tensor from index 'n' of Data tensor.
52inline int DataIndexToMetaDataIndex(int n, int total_tensors) {
53 if (kTensorOrdering == MklTfTensorOrdering::TENSORS_INTERLEAVED) {
54 // For interleaved ordering, OneDNN tensor follows immediately after
55 // Tensorflow tensor.
56 return n + 1;
57 } else {
58 CHECK_EQ(kTensorOrdering, MklTfTensorOrdering::TENSORS_CONTIGUOUS);
59 // For contiguous ordering, OneDNN tensor is n+total_tensors / 2 away.
60 return n + total_tensors / 2;
61 }
62}
63
64int inline GetTensorDataIndex(int n, int total_tensors) {
65 if (kTensorOrdering == MklTfTensorOrdering::TENSORS_INTERLEAVED) {

Callers 3

GetTensorMetaDataIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected