You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for this project! I really like the idea of being able to use Rust for ML!
I'm also relatively new to Rust, so I'm not sure if I'm on the wrong track.
I'd like to dynamically change an ONNX model. For that, I have a struct that will include both an onnx_session_builder (SessionBuilder) and an onnx_session (Session). However, when I create a Session from the SessionBuilder, the SessionBuilder gets moved - with_model_downloaded, with_model_from_file, etc. takes self.
I've tried cloning, Rc, RefCell, or even Box and a combination of them with no success.
Is there a way to make a copy of a SessionBuilder so I can recreate and replace a Session?
Edit:
I was able to make it work by putting the crate as a local dependency and adding the#[derive(Clone)] on SessionBuilder. Are there any reasons not to do this that I'm missing?
The text was updated successfully, but these errors were encountered:
Hi, thanks for this project! I really like the idea of being able to use Rust for ML!
I'm also relatively new to Rust, so I'm not sure if I'm on the wrong track.
I'd like to dynamically change an ONNX model. For that, I have a struct that will include both an
onnx_session_builder
(SessionBuilder
) and anonnx_session
(Session
). However, when I create aSession
from theSessionBuilder
, theSessionBuilder
gets moved -with_model_downloaded
,with_model_from_file
, etc. takesself
.I've tried cloning,
Rc
,RefCell
, or evenBox
and a combination of them with no success.Is there a way to make a copy of a
SessionBuilder
so I can recreate and replace aSession
?Edit:
I was able to make it work by putting the crate as a local dependency and adding the
#[derive(Clone)]
onSessionBuilder
. Are there any reasons not to do this that I'm missing?The text was updated successfully, but these errors were encountered: