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

Method SetDimensionSize

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

Source from the content-addressed store, hash-verified

2587}
2588
2589XlaOp XlaBuilder::SetDimensionSize(XlaOp operand, XlaOp val, int64 dimension) {
2590 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
2591 HloInstructionProto instr;
2592 TF_ASSIGN_OR_RETURN(const Shape* operand_shape, GetShapePtr(operand));
2593 TF_ASSIGN_OR_RETURN(Shape shape, ShapeInference::InferSetDimensionSizeShape(
2594 *operand_shape, dimension));
2595 *instr.mutable_shape() = shape.ToProto();
2596 instr.add_dimensions(dimension);
2597 return AddInstruction(std::move(instr), HloOpcode::kSetDimensionSize,
2598 {operand, val});
2599 });
2600}
2601
2602StatusOr<bool> XlaBuilder::IsConstant(XlaOp operand) const {
2603 TF_RETURN_IF_ERROR(first_error_);

Callers 1

SetDimensionSizeFunction · 0.80

Calls 3

add_dimensionsMethod · 0.80
mutable_shapeMethod · 0.45
ToProtoMethod · 0.45

Tested by

no test coverage detected