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

Function TestMatrixTensorHandle3X2

tensorflow/c/eager/c_api_test_util.cc:120–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120TFE_TensorHandle* TestMatrixTensorHandle3X2() {
121 int64_t dims[] = {3, 2};
122 float data[] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
123 TF_Tensor* t = TF_AllocateTensor(
124 TF_FLOAT, &dims[0], sizeof(dims) / sizeof(int64_t), sizeof(data));
125 memcpy(TF_TensorData(t), &data[0], TF_TensorByteSize(t));
126 TF_Status* status = TF_NewStatus();
127 TFE_TensorHandle* th = TFE_NewTensorHandle(t, status);
128 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
129 TF_DeleteTensor(t);
130 TF_DeleteStatus(status);
131 return th;
132}
133
134TFE_Op* MatMulOp(TFE_Context* ctx, TFE_TensorHandle* a, TFE_TensorHandle* b) {
135 TF_Status* status = TF_NewStatus();

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