Update TryConvertTensorToBroadcastScalar to exit early if constExpTen… (#18495)

Update TryConvertTensorToBroadcastScalar to fail gracefully if not CPU
tensor

### Description
Added early exit for in TryConvertTensorToBroadcastScalar if there is no
CpuData to prevent failure caused by constExpTensor->GetByteData()
throwing.

### Motivation and Context
DmlPrototype branch was failing in QLinearConv when there was no CpuData

---------

Co-authored-by: Christian Larson <28911437+chrilaMSFT@users.noreply.github.com>
This commit is contained in:
Christian Larson 2023-11-17 15:33:27 -08:00 committed by GitHub
parent 5b936221ed
commit e36cc6e27f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -862,7 +862,11 @@ namespace Dml
{
return;
}
else if (!IsCpuData())
{
return;
}
uint32_t totalKernelInputElementCount = constExpTensor->GetTotalElementCount();
if (totalKernelInputElementCount <= 1)
{