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

Function MyCreateFunc

tensorflow/c/kernels_test.cc:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40static bool delete_called = false;
41
42static void* MyCreateFunc(TF_OpKernelConstruction* ctx) {
43 struct MyCustomKernel* s = new struct MyCustomKernel;
44 s->created = true;
45 s->compute_called = false;
46
47 // Exercise attribute reads.
48 TF_DataType type;
49 TF_Status* status = TF_NewStatus();
50 TF_OpKernelConstruction_GetAttrType(ctx, "SomeDataTypeAttr", &type, status);
51 EXPECT_EQ(TF_OK, TF_GetCode(status));
52 EXPECT_EQ(TF_FLOAT, type);
53 TF_DeleteStatus(status);
54
55 return s;
56}
57
58static void MyComputeFunc(void* kernel, TF_OpKernelContext* ctx) {
59 struct MyCustomKernel* s = static_cast<struct MyCustomKernel*>(kernel);

Callers

nothing calls this directly

Calls 3

TF_NewStatusFunction · 0.85
TF_GetCodeFunction · 0.85
TF_DeleteStatusFunction · 0.85

Tested by

no test coverage detected