| 370 | |
| 371 | |
| 372 | TensorImpl::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 | |
| 391 | TensorImpl::TensorImpl(tensorflow::Tensor&& tftensor) |
| 392 | : name_(), dtype_(ConvertDataType(tftensor.dtype())), |
nothing calls this directly
no test coverage detected