Merged PR 4593169: Handle empty tensors in DML EP batched tensor copy

This fixes the test_slice_start_out_of_bounds ONNX test

Related work items: #24837735
This commit is contained in:
Jeff Bloomfield 2020-04-22 23:59:09 +00:00
parent ab2b85649e
commit 7c0b05eca0

View file

@ -571,6 +571,14 @@ namespace Dml
provider,
true);
const size_t dataSizeInBytes = ComputeByteSizeFromTensor(dstWrapper);
THROW_HR_IF(E_INVALIDARG, dataSizeInBytes != ComputeByteSizeFromTensor(srcWrapper)); // Tensors must be the same size
if (dataSizeInBytes == 0)
{
return onnxruntime::common::Status::OK();
}
dataSizesInBytes.push_back(static_cast<uint32_t>(ComputeByteSizeFromTensor(dstWrapper)));
THROW_HR_IF(E_INVALIDARG, dataSizesInBytes[i] != ComputeByteSizeFromTensor(srcWrapper)); // Tensors must be the same size