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

Method BuildTensor

tensorflow/core/framework/tensor.cc:832–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

830}
831
832Status Tensor::BuildTensor(DataType type, const TensorShape& shape,
833 Tensor* out_tensor) {
834 // Avoid crashes due to invalid or unsupported types.
835 CASES_WITH_DEFAULT(
836 type, {}, return errors::InvalidArgument("Type not set"),
837 return errors::InvalidArgument("Unexpected type: ", DataType_Name(type)));
838 *out_tensor = Tensor(type, shape);
839 return Status::OK();
840}
841
842// NOTE(mrry): The default allocator for a Tensor (when none is specified) is
843// the default CPU allocator for NUMA zone 0. Accessing that currently involves

Callers

nothing calls this directly

Calls 2

InvalidArgumentFunction · 0.85
TensorClass · 0.70

Tested by

no test coverage detected