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

Method GetDimensionSize

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

Source from the content-addressed store, hash-verified

2574}
2575
2576XlaOp XlaBuilder::GetDimensionSize(XlaOp operand, int64 dimension) {
2577 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
2578 HloInstructionProto instr;
2579 TF_ASSIGN_OR_RETURN(const Shape* operand_shape, GetShapePtr(operand));
2580 TF_ASSIGN_OR_RETURN(Shape shape, ShapeInference::InferGetDimensionSizeShape(
2581 *operand_shape, dimension));
2582 *instr.mutable_shape() = shape.ToProto();
2583 instr.add_dimensions(dimension);
2584 return AddInstruction(std::move(instr), HloOpcode::kGetDimensionSize,
2585 {operand});
2586 });
2587}
2588
2589XlaOp XlaBuilder::SetDimensionSize(XlaOp operand, XlaOp val, int64 dimension) {
2590 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {

Callers 1

GetDimensionSizeFunction · 0.80

Calls 3

add_dimensionsMethod · 0.80
mutable_shapeMethod · 0.45
ToProtoMethod · 0.45

Tested by

no test coverage detected