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

Method Rev

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

Source from the content-addressed store, hash-verified

1589}
1590
1591XlaOp XlaBuilder::Rev(XlaOp operand, absl::Span<const int64> dimensions) {
1592 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
1593 HloInstructionProto instr;
1594 TF_ASSIGN_OR_RETURN(const Shape* operand_shape, GetShapePtr(operand));
1595 TF_ASSIGN_OR_RETURN(Shape shape, ShapeInference::InferReverseShape(
1596 *operand_shape, dimensions));
1597 *instr.mutable_shape() = shape.ToProto();
1598 for (int64 dim : dimensions) {
1599 instr.add_dimensions(dim);
1600 }
1601 return AddInstruction(std::move(instr), HloOpcode::kReverse, {operand});
1602 });
1603}
1604
1605XlaOp XlaBuilder::Sort(absl::Span<const XlaOp> operands,
1606 const XlaComputation& comparator, int64 dimension,

Callers 2

RevFunction · 0.80
testRevMethod · 0.80

Calls 3

add_dimensionsMethod · 0.80
mutable_shapeMethod · 0.45
ToProtoMethod · 0.45

Tested by 1

testRevMethod · 0.64