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

Function GetClientBuilder

tensorflow/compiler/mlir/xla/operator_writer_gen.cc:55–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static StringRef GetClientBuilder(const Operator& op) {
56 static const auto* kOpToXLABuilderMap =
57 new llvm::StringMap<StringRef>{{"ReverseOp", "Rev"},
58 {"ConcatenateOp", "ConcatInDim"},
59 {"ConvOp", "ConvGeneralDilated"}};
60
61 StringRef op_name = op.getCppClassName();
62
63 // Default case where the client builder method names closely follow the op
64 // names in the dialect. For e.g., AddOp -> xla::Add method.
65 if (!kOpToXLABuilderMap->count(op_name)) return op_name.drop_back(2);
66
67 // Otherwise, if the op to client builder method mapping is provided.
68 return kOpToXLABuilderMap->lookup(op_name);
69}
70
71static void BuildOperator(const Operator& op, raw_ostream* output) {
72 auto& os = *output;

Callers 1

BuildOperatorFunction · 0.85

Calls 2

countMethod · 0.45
lookupMethod · 0.45

Tested by

no test coverage detected