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

Function AsTensor

tensorflow/core/framework/tensor_testutil.h:39–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37// Constructs a flat tensor with 'vals'.
38template <typename T>
39Tensor AsTensor(gtl::ArraySlice<T> vals) {
40 Tensor ret(DataTypeToEnum<T>::value, {static_cast<int64>(vals.size())});
41 std::copy_n(vals.data(), vals.size(), ret.flat<T>().data());
42 return ret;
43}
44
45// Constructs a tensor of "shape" with values "vals".
46template <typename T>

Callers 6

TestCopiesFunction · 0.70
TESTFunction · 0.70
ExpectNodeCloseMethod · 0.50
ExpectNodeEqualMethod · 0.50
ConstantMethod · 0.50
ExpectNodeEqualFunction · 0.50

Calls 3

sizeMethod · 0.45
dataMethod · 0.45
CopyFromMethod · 0.45

Tested by

no test coverage detected