Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix]Fix ortwrap #81

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mmdeploy/backend/onnxruntime/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os.path as osp
from typing import Dict, Optional, Sequence

import numpy as np
import onnxruntime as ort
import torch

Expand Down Expand Up @@ -80,11 +79,12 @@ def forward(self, inputs: Dict[str,
input_tensor = input_tensor.contiguous()
if not self.is_cuda_available:
input_tensor = input_tensor.cpu()
element_type = input_tensor.numpy().dtype
self.io_binding.bind_input(
name=name,
device_type=self.device_type,
device_id=self.device_id,
element_type=np.float32,
element_type=element_type,
shape=input_tensor.shape,
buffer_ptr=input_tensor.data_ptr())

Expand Down