| 40 | static bool delete_called = false; |
| 41 | |
| 42 | static 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 | |
| 58 | static void MyComputeFunc(void* kernel, TF_OpKernelContext* ctx) { |
| 59 | struct MyCustomKernel* s = static_cast<struct MyCustomKernel*>(kernel); |
nothing calls this directly
no test coverage detected