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

Method GetOrCreateMin

tensorflow/compiler/tf2xla/xla_context.cc:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95const xla::XlaComputation* XlaContext::GetOrCreateMin(const DataType type) {
96 return LookupOrCreate(type, &min_func_, [type] {
97 const string type_string = DataTypeString(type);
98 VLOG(1) << "Building Min() for " << type_string;
99 xla::XlaBuilder b("min<" + type_string + ">");
100 xla::PrimitiveType xla_type;
101 TF_CHECK_OK(DataTypeToPrimitiveType(type, &xla_type));
102 auto x =
103 xla::Parameter(&b, 0, xla::ShapeUtil::MakeShape(xla_type, {}), "x");
104 auto y =
105 xla::Parameter(&b, 1, xla::ShapeUtil::MakeShape(xla_type, {}), "y");
106 xla::Min(x, y);
107 return b.Build().ConsumeValueOrDie();
108 });
109}
110
111const xla::XlaComputation* XlaContext::GetOrCreateAdd(const DataType type) {
112 return LookupOrCreate(type, &add_func_, [type] {

Callers 1

CompileMethod · 0.45

Calls 8

LookupOrCreateFunction · 0.85
DataTypeToPrimitiveTypeFunction · 0.85
MakeShapeFunction · 0.85
ConsumeValueOrDieMethod · 0.80
DataTypeStringFunction · 0.50
ParameterFunction · 0.50
MinFunction · 0.50
BuildMethod · 0.45

Tested by

no test coverage detected