diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorLayerNormalization.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorLayerNormalization.cpp index 5883fc62c3..8858529056 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorLayerNormalization.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/Operators/DmlOperatorLayerNormalization.cpp @@ -54,14 +54,17 @@ public: void CALLBACK QueryLayerNormalization(IMLOperatorSupportQueryContextPrivate* context, /*out*/ bool* isSupported) { - *isSupported = true; + *isSupported = false; // Mean and InvStdDev are not supported outputs. - if (context->GetOutputCount() > 1) + // If only Scale tensor is present then fall back to CPU. This is temporary until + // DML1.9.2 or DML1.10 gets released. + if (context->GetInputCount() < 3 || context->GetOutputCount() > 1) { - *isSupported = false; return; } + + *isSupported = true; } DML_OP_DEFINE_CREATION_FUNCTION(LayerNormalization, DmlOperatorLayerNormalization); diff --git a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.cpp b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.cpp index 9d3652f99c..32a3a1b053 100644 --- a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.cpp +++ b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.cpp @@ -592,7 +592,7 @@ namespace OperatorHelper int32_t transBatch, int32_t transpose) { - const uint32_t dimensionCount = sizes.size(); + const uint32_t dimensionCount = gsl::narrow_cast(sizes.size()); std::vector newStrides(dimensionCount); std::vector newSizes(sizes.begin(), sizes.end());