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

Function FillValues

tensorflow/core/framework/tensor_testutil.h:57–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55// test::FillValues<float>(&x, {11, 21, 21, 22});
56template <typename T>
57void FillValues(Tensor* tensor, gtl::ArraySlice<T> vals) {
58 auto flat = tensor->flat<T>();
59 CHECK_EQ(flat.size(), vals.size());
60 if (flat.size() > 0) {
61 std::copy_n(vals.data(), vals.size(), flat.data());
62 }
63}
64
65// Fills in '*tensor' with 'vals', converting the types as needed.
66template <typename T, typename SrcType>

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected