Skip to content

Commit 73084ab

Browse files
committed
Fix output_size
1 parent 1bf307b commit 73084ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

onnxruntime/core/providers/webgpu/tensor/transpose.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,14 @@ Status Transpose::DoTranspose(onnxruntime::webgpu::ComputeContextBase& context,
131131
new_output_shape = TensorShape({new_input_shape[1], new_input_shape[0]});
132132
}
133133

134-
uint32_t output_size = onnxruntime::narrow<int32_t>(input_shape.Size());
134+
uint32_t output_size = onnxruntime::narrow<uint32_t>(input_shape.Size());
135135
TransposeProgram program{permutations, use_shared};
136136

137137
program
138138
.CacheHint(absl::StrJoin(permutations, "-"))
139139
.AddInputs({{&input, ProgramTensorMetadataDependency::TypeAndRank, new_input_shape, 1}})
140140
.AddOutputs({{&output, ProgramTensorMetadataDependency::None, new_output_shape, 1}})
141-
.AddUniformVariables({
142-
{static_cast<uint32_t>(output_size)},
143-
});
141+
.AddUniformVariables({{output_size}});
144142

145143
if (use_shared) {
146144
program.SetWorkgroupSize(TILE_SIZE, TILE_SIZE, 1);

0 commit comments

Comments
 (0)