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

Function TestMatrixTensorHandle100x100

tensorflow/c/eager/c_api_test_util.cc:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88TFE_TensorHandle* TestMatrixTensorHandle100x100() {
89 constexpr int64_t dims[] = {100, 100};
90 constexpr int num_elements = dims[0] * dims[1];
91 float data[num_elements];
92 for (int i = 0; i < num_elements; ++i) {
93 data[i] = 1.0f;
94 }
95 TF_Tensor* t = TF_AllocateTensor(
96 TF_FLOAT, &dims[0], sizeof(dims) / sizeof(int64_t), sizeof(data));
97 memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
98 TF_Status* status = TF_NewStatus();
99 TFE_TensorHandle* th = TFE_NewTensorHandle(t, status);
100 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
101 TF_DeleteTensor(t);
102 TF_DeleteStatus(status);
103 return th;
104}
105
106TFE_TensorHandle* DoubleTestMatrixTensorHandle3X2() {
107 int64_t dims[] = {3, 2};

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