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

Function TestMatrixTensorHandle

tensorflow/c/eager/c_api_test_util.cc:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74TFE_TensorHandle* TestMatrixTensorHandle() {
75 int64_t dims[] = {2, 2};
76 float data[] = {1.0f, 2.0f, 3.0f, 4.0f};
77 TF_Tensor* t = TF_AllocateTensor(
78 TF_FLOAT, &dims[0], sizeof(dims) / sizeof(int64_t), sizeof(data));
79 memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
80 TF_Status* status = TF_NewStatus();
81 TFE_TensorHandle* th = TFE_NewTensorHandle(t, status);
82 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
83 TF_DeleteTensor(t);
84 TF_DeleteStatus(status);
85 return th;
86}
87
88TFE_TensorHandle* TestMatrixTensorHandle100x100() {
89 constexpr int64_t dims[] = {100, 100};

Callers 15

TESTFunction · 0.85
TEST_FFunction · 0.85
BM_InitOpFunction · 0.85
BM_ExecuteFunction · 0.85
BM_Execute_IdentityFunction · 0.85
TestRemoteExecuteFunction · 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