Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing reference of input array #11

Open
nbigaouette opened this issue Aug 9, 2020 · 1 comment
Open

Support passing reference of input array #11

nbigaouette opened this issue Aug 9, 2020 · 1 comment

Comments

@nbigaouette
Copy link
Owner

nbigaouette commented Aug 9, 2020

As of 42def76, the ndarray::Array input ownership is transferred to Session::run().

pub fn run<T, D>(&mut self, input_arrays: Vec<Array<T, D>>) -> Result<Vec<Vec<T>>>

This means the input is dropped at the end of the inference. Would it be possible to pass a reference instead so that the input can be reused?

@aldanor
Copy link

aldanor commented Nov 28, 2020

That's the first two things I was wondering about when looking at .run() signature:

  • Why is Array input ownership transferred over?.. If your input is a few kilobytes (megabytes) long, it has to be copied over every time?
  • If Array ownership transfer wasn't required, then the input could be &[Array] or even impl Iterator<Array>?

@nbigaouette nbigaouette mentioned this issue Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants