| 39 | } |
| 40 | |
| 41 | Tensor::Tensor(std::shared_ptr<vk::PhysicalDevice> physicalDevice, |
| 42 | std::shared_ptr<vk::Device> device, |
| 43 | void* data, |
| 44 | uint32_t elementTotalCount, |
| 45 | uint32_t elementMemorySize, |
| 46 | const TensorDataTypes& dataType, |
| 47 | const TensorTypes& tensorType) |
| 48 | { |
| 49 | KP_LOG_DEBUG("Kompute Tensor constructor data length: {}, and type: {}", |
| 50 | elementTotalCount, |
| 51 | Tensor::toString(tensorType)); |
| 52 | |
| 53 | this->mPhysicalDevice = physicalDevice; |
| 54 | this->mDevice = device; |
| 55 | this->mDataType = dataType; |
| 56 | this->mTensorType = tensorType; |
| 57 | |
| 58 | this->rebuild(data, elementTotalCount, elementMemorySize); |
| 59 | } |
| 60 | |
| 61 | Tensor::~Tensor() |
| 62 | { |