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

Function ShouldTranspose

tensorflow/core/kernels/einsum_op.cc:311–318  ·  view source on GitHub ↗

Returns whether transposing would be a no-op; whether input has rank < 2 or the permutation is the identity permutation.

Source from the content-addressed store, hash-verified

309// Returns whether transposing would be a no-op; whether input has rank < 2 or
310// the permutation is the identity permutation.
311bool ShouldTranspose(const TensorShape& input_shape,
312 const std::vector<int>& permutation) {
313 if (input_shape.dims() < 2) return false;
314 for (int i = 0; i < permutation.size(); ++i) {
315 if (permutation[i] != i) return true;
316 }
317 return false;
318}
319
320// Transpose the input given a permutation. Returns a reference to the input if
321// transposing is not necessary.

Callers 1

TransposeOperandFunction · 0.85

Calls 2

dimsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected