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

Function MkTensor

tensorflow/core/framework/tensor_test.cc:1311–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1309
1310template <typename T>
1311Tensor MkTensor(DataType dt, const TensorShape& shape,
1312 std::vector<T> init_values) {
1313 Tensor x(dt, shape);
1314 const int limit = x.NumElements();
1315 int vi = 0;
1316 for (int i = 0; i < limit; ++i) {
1317 x.flat<T>()(i) = init_values[vi++];
1318 if (vi >= init_values.size()) vi = 0;
1319 }
1320 return x;
1321}
1322
1323TEST(SummarizeValue, Uninitialized) {
1324 Tensor x(DT_INT32);

Callers

nothing calls this directly

Calls 2

NumElementsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected