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

Function Int32Tensor

tensorflow/c/c_test_util.cc:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64TF_Tensor* Int32Tensor(const int64_t* dims, int num_dims,
65 const int32_t* values) {
66 int64_t num_values = 1;
67 for (int i = 0; i < num_dims; ++i) {
68 num_values *= dims[i];
69 }
70 TF_Tensor* t =
71 TF_AllocateTensor(TF_INT32, dims, num_dims, sizeof(int32_t) * num_values);
72 memcpy(TF_TensorData(t), values, sizeof(int32_t) * num_values);
73 return t;
74}
75
76TF_Tensor* Int32Tensor(const std::vector<int32_t>& values) {
77 int64_t dims = values.size();

Callers 7

RunMethod · 0.85
TEST_FFunction · 0.85
DefineStatefulFunctionFunction · 0.85
ScalarConstFunction · 0.85
TESTFunction · 0.85
RunMinTestFunction · 0.85
TEST_FFunction · 0.85

Calls 5

TF_AllocateTensorFunction · 0.85
TF_TensorDataFunction · 0.85
TF_NewTensorFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected