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

Method Select

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

Source from the content-addressed store, hash-verified

1065}
1066
1067XlaOp XlaBuilder::Select(XlaOp pred, XlaOp on_true, XlaOp on_false) {
1068 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
1069 TF_ASSIGN_OR_RETURN(const Shape* true_shape, GetShapePtr(on_true));
1070 TF_ASSIGN_OR_RETURN(const Shape* false_shape, GetShapePtr(on_false));
1071 TF_RET_CHECK(true_shape->IsTuple() == false_shape->IsTuple());
1072 HloOpcode opcode =
1073 true_shape->IsTuple() ? HloOpcode::kTupleSelect : HloOpcode::kSelect;
1074 return TernaryOp(opcode, pred, on_true, on_false);
1075 });
1076}
1077
1078XlaOp XlaBuilder::Tuple(absl::Span<const XlaOp> elements) {
1079 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {

Callers 2

SelectFunction · 0.45
testSelectMethod · 0.45

Calls 1

IsTupleMethod · 0.45

Tested by 1

testSelectMethod · 0.36