File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11.PHONY : all
2- all : noop classify exec nonser tf tflite exec_genop
2+ all : noop classify exec nonser tf tflite exec_genop torch
33
44prepare :
55 @go mod tidy
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ func TorchModelRun(
200200 inTensors []TorchTensor ,
201201 outTensors * []TorchTensor ,
202202) int {
203- if sess == nil || model == nil || buffer == nil || outTensors == nil {
203+ if sess == nil || model == nil || outTensors == nil {
204204 return EINVAL
205205 }
206206
@@ -223,10 +223,17 @@ func TorchModelRun(
223223 cOutPtr := C .malloc (outBufSize )
224224 defer C .free (cOutPtr )
225225
226+ var bufPtr * C.struct_vaccel_torch_buffer
227+ if buffer != nil {
228+ bufPtr = & buffer .cTorchBuffer
229+ } else {
230+ bufPtr = nil
231+ }
232+
226233 ret := int (C .vaccel_torch_model_run (
227234 & sess .cSess ,
228235 & model .cRes ,
229- & buffer . cTorchBuffer ,
236+ bufPtr ,
230237 (* * C .struct_vaccel_torch_tensor )(cInPtr ),
231238 C .int (nrInputs ),
232239 (* * C .struct_vaccel_torch_tensor )(cOutPtr ),
You can’t perform that action at this time.
0 commit comments