mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[ortmodule] Ensure contiguous tensor into forward pass (#10315)
This commit is contained in:
parent
b038f4e56f
commit
7b14c70cfe
1 changed files with 3 additions and 0 deletions
|
|
@ -52,6 +52,9 @@ class TrainingManager(GraphExecutionManager):
|
|||
forward_inputs = C.OrtValueVector()
|
||||
forward_inputs.reserve(len(inputs))
|
||||
for input in inputs:
|
||||
# TODO: Non-contiguous tensor input in execution_session_run_forward, need tensor copy.
|
||||
if not input.is_contiguous():
|
||||
input = input.contiguous()
|
||||
if input.device.type == 'ort':
|
||||
forward_inputs.push_back(C.aten_ort_tensor_to_ort_value(input))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue