| 95 | } |
| 96 | |
| 97 | TF_Tensor* FloatTensor(float v) { |
| 98 | const int num_bytes = sizeof(float); |
| 99 | float* values = new float[1]; |
| 100 | values[0] = v; |
| 101 | return TF_NewTensor(TF_FLOAT, nullptr, 0, values, num_bytes, |
| 102 | &FloatDeallocator, nullptr); |
| 103 | } |
| 104 | |
| 105 | // All the *Helper methods are used as a workaround for the restrictions that |
| 106 | // one cannot call ASSERT_* methods in non-void-returning functions (when |
no test coverage detected