Skip to content

Commit a441ffc

Browse files
committed
fix contiguous
1 parent 74aa500 commit a441ffc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

onnx_diagnostic/ort_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ def run_dlpack(
439439
new_feeds = {}
440440
for k, v in feeds.items():
441441
assert hasattr(v, "__dlpack__"), f"class {type(v)} should be serialized"
442+
if not v.is_contiguous():
443+
v = v.contiguous()
442444
new_feeds[k] = ORTC.OrtValue.from_dlpack(v.__dlpack__(), v.dtype == torch.bool)
443445
if self.nvtx:
444446
self.torch.cuda.nvtx.range_push("run_with_ort_values")

0 commit comments

Comments
 (0)