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

Function TransposeInMinorDims

tensorflow/compiler/xla/client/lib/matrix.cc:663–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663XlaOp TransposeInMinorDims(XlaOp x) {
664 XlaBuilder* builder = x.builder();
665 return builder->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
666 TF_ASSIGN_OR_RETURN(Shape shape, builder->GetShape(x));
667 const int64 n_dims = shape.rank();
668 TF_RET_CHECK(n_dims >= 2);
669 std::vector<int64> permutation(n_dims);
670 std::iota(permutation.begin(), permutation.end(), 0);
671 std::swap(permutation[n_dims - 1], permutation[n_dims - 2]);
672 return Transpose(x, permutation);
673 });
674}
675
676XlaOp MaybeTransposeInMinorDims(XlaOp x, bool transpose) {
677 return transpose ? TransposeInMinorDims(x) : x;

Callers 11

CompileMethod · 0.85
CompileMethod · 0.85
SVDFunction · 0.85
SelfAdjointEigFunction · 0.85
ComputeMatmulVWVtMethod · 0.85
XLA_TEST_FFunction · 0.85
ComputeMatmulUDVTMethod · 0.85
XLA_TEST_FFunction · 0.85
XLA_TEST_FFunction · 0.85
XLA_TEST_PFunction · 0.85

Calls 6

ReportErrorOrReturnMethod · 0.80
TransposeFunction · 0.50
builderMethod · 0.45
rankMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 6

ComputeMatmulVWVtMethod · 0.68
XLA_TEST_FFunction · 0.68
ComputeMatmulUDVTMethod · 0.68
XLA_TEST_FFunction · 0.68
XLA_TEST_FFunction · 0.68
XLA_TEST_PFunction · 0.68