| 830 | } |
| 831 | |
| 832 | Status 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 |
nothing calls this directly
no test coverage detected