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

Method Transpose

tensorflow/compiler/xla/client/xla_builder.cc:1576–1589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1574}
1575
1576XlaOp XlaBuilder::Transpose(XlaOp operand,
1577 absl::Span<const int64> permutation) {
1578 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
1579 HloInstructionProto instr;
1580 TF_ASSIGN_OR_RETURN(const Shape* operand_shape, GetShapePtr(operand));
1581 TF_ASSIGN_OR_RETURN(Shape shape, ShapeInference::InferTransposeShape(
1582 *operand_shape, permutation));
1583 *instr.mutable_shape() = shape.ToProto();
1584 for (int64 dim : permutation) {
1585 instr.add_dimensions(dim);
1586 }
1587 return AddInstruction(std::move(instr), HloOpcode::kTranspose, {operand});
1588 });
1589}
1590
1591XlaOp XlaBuilder::Rev(XlaOp operand, absl::Span<const int64> dimensions) {
1592 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {

Callers 2

TransposeFunction · 0.45
HandleTransposeMethod · 0.45

Calls 3

add_dimensionsMethod · 0.80
mutable_shapeMethod · 0.45
ToProtoMethod · 0.45

Tested by

no test coverage detected