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

Function DoubleTestMatrixTensorHandle

tensorflow/c/eager/c_api_test_util.cc:60–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60TFE_TensorHandle* DoubleTestMatrixTensorHandle() {
61 int64_t dims[] = {2, 2};
62 double data[] = {1.0, 2.0, 3.0, 4.0};
63 TF_Tensor* t = TF_AllocateTensor(
64 TF_DOUBLE, &dims[0], sizeof(dims) / sizeof(int64_t), sizeof(data));
65 memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
66 TF_Status* status = TF_NewStatus();
67 TFE_TensorHandle* th = TFE_NewTensorHandle(t, status);
68 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
69 TF_DeleteTensor(t);
70 TF_DeleteStatus(status);
71 return th;
72}
73
74TFE_TensorHandle* TestMatrixTensorHandle() {
75 int64_t dims[] = {2, 2};

Callers 1

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