Skip to content

Commit cfb9099

Browse files
authored
fix ort wrap about input type (#81)
1 parent 8ceb001 commit cfb9099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mmdeploy/backend/onnxruntime/wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os.path as osp
33
from typing import Dict, Optional, Sequence
44

5-
import numpy as np
65
import onnxruntime as ort
76
import torch
87

@@ -80,11 +79,12 @@ def forward(self, inputs: Dict[str,
8079
input_tensor = input_tensor.contiguous()
8180
if not self.is_cuda_available:
8281
input_tensor = input_tensor.cpu()
82+
element_type = input_tensor.numpy().dtype
8383
self.io_binding.bind_input(
8484
name=name,
8585
device_type=self.device_type,
8686
device_id=self.device_id,
87-
element_type=np.float32,
87+
element_type=element_type,
8888
shape=input_tensor.shape,
8989
buffer_ptr=input_tensor.data_ptr())
9090

0 commit comments

Comments
 (0)