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

Method TensorImpl

addons/triton/tensorflow_backend_tf.cc:372–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370
371
372TensorImpl::TensorImpl(
373 const char* name, TRITONTF_DataType dtype, TRITONTF_Shape* shape,
374 const tensorflow::TensorShape& tfshape, const int tf_gpu_id)
375 : name_(name), dtype_(dtype), shape_(shape)
376{
377 // Only request for GPU allocator for supported data type
378 auto a = ((tf_gpu_id >= 0) && IsGPUFeedAndFetchSupported(dtype))
379 ? tensorflow::GPUProcessState::singleton()->GetGPUAllocator(
380 tensorflow::GPUOptions(), tensorflow::TfGpuId(tf_gpu_id),
381 1 << 28 /* total_memory_size */)
382 : nullptr;
383 if (a == nullptr) {
384 tftensor_ = tensorflow::Tensor(ConvertDataType(dtype), tfshape);
385 } else {
386 tftensor_ = tensorflow::Tensor(a, ConvertDataType(dtype), tfshape);
387 }
388 Init();
389}
390
391TensorImpl::TensorImpl(tensorflow::Tensor&& tftensor)
392 : name_(), dtype_(ConvertDataType(tftensor.dtype())),

Callers

nothing calls this directly

Calls 9

GPUOptionsClass · 0.85
ConvertShapeFunction · 0.85
GetGPUAllocatorMethod · 0.80
ConvertDataTypeFunction · 0.70
TensorClass · 0.50
InitFunction · 0.50
dtypeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected