diff --git a/onnxruntime/core/providers/webgpu/math/softmax.cc b/onnxruntime/core/providers/webgpu/math/softmax.cc index 4541b7a65a..694cc0bd5b 100644 --- a/onnxruntime/core/providers/webgpu/math/softmax.cc +++ b/onnxruntime/core/providers/webgpu/math/softmax.cc @@ -38,7 +38,7 @@ ONNX_OPERATOR_KERNEL_EX( .TypeConstraint("T", WebGpuSupportedNumberTypes()), Softmax); -static std::string MaxVector(std::string name, int components) { +static std::string MaxVector(const std::string& name, int components) { switch (components) { case 1: return name; @@ -53,7 +53,7 @@ static std::string MaxVector(std::string name, int components) { } } -static std::string SumVector(std::string x, int components) { +static std::string SumVector(const std::string& x, int components) { switch (components) { case 1: return x; @@ -184,7 +184,7 @@ Status Softmax::ComputeInternal(ComputeContext& context) const { perm[axis] = input_rank - 1; perm[input_rank - 1] = axis; - std::vector transposed_input_dims; + TensorShapeVector transposed_input_dims; for (auto e : perm) { transposed_input_dims.push_back(input_shape[e]); } diff --git a/onnxruntime/core/providers/webgpu/tensor/transpose.cc b/onnxruntime/core/providers/webgpu/tensor/transpose.cc index 97d7332507..bbce111e9b 100644 --- a/onnxruntime/core/providers/webgpu/tensor/transpose.cc +++ b/onnxruntime/core/providers/webgpu/tensor/transpose.cc @@ -108,10 +108,8 @@ Status Transpose::DoTranspose(onnxruntime::webgpu::ComputeContext& context, gsl: output_dims[i] = input_dims[permutations[i]]; } - TensorShape output_shape(output_dims); - - InlinedVector new_shape{}; - InlinedVector new_perm{}; + TensorShapeVector new_shape{}; + TensorShapeVector new_perm{}; SqueezeShape(input_shape.GetDims(), permutations, new_shape, new_perm); const bool channels_last = new_perm == InlinedVector({2, 3, 1}); const bool channels_first = new_perm == InlinedVector({3, 1, 2});