| 742 | } |
| 743 | |
| 744 | TFE_TensorHandle* TFE_NewTensorHandleFromScalar(TF_DataType data_type, |
| 745 | void* data, size_t len, |
| 746 | TF_Status* status) { |
| 747 | auto dtype = static_cast<tensorflow::DataType>(data_type); |
| 748 | DCHECK(tensorflow::DataTypeCanUseMemcpy(dtype)); |
| 749 | |
| 750 | tensorflow::Tensor tensor(dtype, tensorflow::TensorShape({})); |
| 751 | std::memcpy(tensorflow::TensorCApi::Buffer(tensor)->data(), data, len); |
| 752 | return TFE_TensorHandle::CreateLocalHandle(tensor, status); |
| 753 | } |
| 754 | |
| 755 | namespace { |
| 756 | tensorflow::Status EnableCollectiveOps(const tensorflow::ServerDef& server_def, |
nothing calls this directly
no test coverage detected