Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Jun 5, 2024
1 parent 06dbf89 commit d584a88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions optimum/onnxruntime/modeling_ort.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,6 @@ class ORTModelForSemanticSegmentation(ORTModel):
checkpoint="optimum/segformer-b0-finetuned-ade-512-512",
)
)

def forward(
self,
pixel_values: Union[torch.Tensor, np.ndarray],
Expand All @@ -1737,13 +1736,12 @@ def forward(
self.raise_on_numpy_input_io_binding(use_torch)

if self.device.type == "cuda" and self.use_io_binding:
io_binding = IOBindingHelper.prepare_io_binding(
self,
io_binding, output_shapes, output_buffers = self.prepare_io_binding(
pixel_values,
ordered_input_names=self._ordered_input_names,
)

# run inference with binding
# run inference with binding & synchronize in case of multiple CUDA streams
io_binding.synchronize_inputs()
self.model.run_with_iobinding(io_binding)
io_binding.synchronize_outputs()
Expand Down

0 comments on commit d584a88

Please sign in to comment.