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

Function _transpose_if_necessary

tensorflow/python/ops/special_math_ops.py:522–527  ·  view source on GitHub ↗

Like transpose(), but avoids creating a new tensor if possible.

(tensor, perm)

Source from the content-addressed store, hash-verified

520
521
522def _transpose_if_necessary(tensor, perm):
523 """Like transpose(), but avoids creating a new tensor if possible."""
524 if perm != list(range(len(perm))):
525 return array_ops.transpose(tensor, perm=perm)
526 else:
527 return tensor
528
529
530def _reshape_if_necessary(tensor, new_shape):

Callers 2

einsumFunction · 0.85
_einsum_reductionFunction · 0.85

Calls 2

transposeMethod · 0.80
rangeFunction · 0.70

Tested by

no test coverage detected