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

Function TFE_NewTensorHandleFromScalar

tensorflow/c/c_api_experimental.cc:744–753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744TFE_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
755namespace {
756tensorflow::Status EnableCollectiveOps(const tensorflow::ServerDef& server_def,

Callers

nothing calls this directly

Calls 4

DataTypeCanUseMemcpyFunction · 0.85
TensorShapeClass · 0.50
BufferClass · 0.50
dataMethod · 0.45

Tested by

no test coverage detected