mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-17 21:10:43 +00:00
Cherry pick fix constant pow (#18785)
### Description Cherry pick https://github.com/microsoft/onnxruntime/pull/18784
This commit is contained in:
parent
107d7492b9
commit
d2f7a5b128
2 changed files with 3 additions and 3 deletions
|
|
@ -479,7 +479,7 @@ public:
|
|||
ML_CHECK_VALID_ARGUMENT(kernelInfo.GetInputCount() == 2);
|
||||
ML_CHECK_VALID_ARGUMENT(kernelInfo.GetOutputCount() == 1);
|
||||
|
||||
auto constExpTensor = kernelInfo.TryGetConstantInputTensor(1);
|
||||
auto constExpTensor = kernelInfo.TryGetConstantCpuInputTensor(1);
|
||||
if (constExpTensor && constExpTensor->GetTotalElementCount() == 1)
|
||||
{
|
||||
std::vector<std::optional<uint32_t>> kernelInputIndices = {0};
|
||||
|
|
|
|||
|
|
@ -605,11 +605,11 @@ public:
|
|||
return MLOperatorTensor(tensor.Get());
|
||||
}
|
||||
|
||||
std::optional<MLOperatorTensor> TryGetConstantInputTensor(uint32_t inputIndex) const
|
||||
std::optional<MLOperatorTensor> TryGetConstantCpuInputTensor(uint32_t inputIndex) const
|
||||
{
|
||||
Microsoft::WRL::ComPtr<IMLOperatorTensor> tensor;
|
||||
ORT_THROW_IF_FAILED(m_implPrivate->TryGetConstantInputTensor(inputIndex, &tensor));
|
||||
if (tensor)
|
||||
if (tensor && tensor->IsCpuData())
|
||||
{
|
||||
return MLOperatorTensor(tensor.Get());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue