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

Function TestScalarTensorHandle

tensorflow/c/eager/c_api_test_util.cc:24–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using tensorflow::string;
23
24TFE_TensorHandle* TestScalarTensorHandle(float value) {
25 float data[] = {value};
26 TF_Tensor* t = TF_AllocateTensor(TF_FLOAT, nullptr, 0, sizeof(float));
27 memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
28 TF_Status* status = TF_NewStatus();
29 TFE_TensorHandle* th = TFE_NewTensorHandle(t, status);
30 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
31 TF_DeleteTensor(t);
32 TF_DeleteStatus(status);
33 return th;
34}
35
36TFE_TensorHandle* TestScalarTensorHandle(int value) {
37 int data[] = {value};

Callers 3

TEST_FFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85

Calls 9

TF_AllocateTensorFunction · 0.85
TF_TensorDataFunction · 0.85
TF_TensorByteSizeFunction · 0.85
TF_NewStatusFunction · 0.85
TFE_NewTensorHandleFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TF_DeleteTensorFunction · 0.85
TF_DeleteStatusFunction · 0.85

Tested by

no test coverage detected