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

Function GetFakeKernel

tensorflow/c/kernels_test.cc:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74namespace tensorflow {
75
76static std::unique_ptr<OpKernel> GetFakeKernel(const char* device_name,
77 const char* op_name,
78 Status* status) {
79 NodeDef def;
80 def.set_op(op_name);
81 def.set_device(device_name);
82 def.add_input("input1");
83 def.add_input("input2");
84
85 AttrValue v;
86 v.set_type(DataType::DT_FLOAT);
87 (*def.mutable_attr())["SomeDataTypeAttr"] = v;
88
89 return CreateOpKernel(DeviceType(device_name), nullptr, nullptr, def, 1,
90 status);
91}
92
93// Tests registration of a single C kernel and checks that calls through the
94// C/C++ boundary are being made.

Callers 1

TESTFunction · 0.85

Calls 5

CreateOpKernelFunction · 0.85
DeviceTypeClass · 0.85
set_opMethod · 0.80
set_deviceMethod · 0.45
add_inputMethod · 0.45

Tested by

no test coverage detected