This commit is contained in:
Alejandro Saucedo 2021-03-07 14:45:31 +00:00
parent 1d2d33b269
commit 1d1018fa0c
22 changed files with 326 additions and 259 deletions

View file

@ -18,13 +18,16 @@ OpTensorCopy::OpTensorCopy(const std::vector<std::shared_ptr<Tensor>>& tensors)
uint32_t size = this->mTensors[0]->size();
for (const std::shared_ptr<Tensor>& tensor : tensors) {
if (tensor->dataType() != dataType) {
throw std::runtime_error(fmt::format("Attempting to copy tensors of different types from {} to {}",
dataType, tensor->dataType()));
throw std::runtime_error(fmt::format(
"Attempting to copy tensors of different types from {} to {}",
dataType,
tensor->dataType()));
}
if (tensor->size() != size) {
throw std::runtime_error(fmt::format("Attempting to copy tensors of different sizes from {} to {}",
size, tensor->size()));
throw std::runtime_error(fmt::format(
"Attempting to copy tensors of different sizes from {} to {}",
size,
tensor->size()));
}
}
}