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

menoh_model_get_variable_dims() #48

Closed
enobufs opened this issue Jul 17, 2018 · 6 comments
Closed

menoh_model_get_variable_dims() #48

enobufs opened this issue Jul 17, 2018 · 6 comments
Labels
enhancement New feature or request

Comments

@enobufs
Copy link

enobufs commented Jul 17, 2018

In node-menoh, I wrote this helper function. It would be nice if there's a C-API function in menoh something similar (if possible) to the following:

int32_t size;
const int32_t *dims;
ec = menoh_model_get_variable_dims(model_handle, var_name, &size, &dims);

Where;

menoh_error_code  menoh_model_get_variable_dims(
    const menoh_model_handle model,
    const char* variable_name, 
    int32_t *size,
    const int32_t **dims);

It is sort of combining _get_variable_dims_size and _get_variable_dims_at all together without having to iterate over _dims_at function with its size...

Assumption: the dims values won't change unless the profile was altered by the app.

@msakai
Copy link
Member

msakai commented Jul 17, 2018

It's nice for efficiency to avoid repeated lookup with variable_name across multiple invocation of menoh_model_get_variable_dims_at (at least mentally).

@okdshin
Copy link
Contributor

okdshin commented Jul 17, 2018

I wonder how to manage the memory pointed by dims.

@msakai
Copy link
Member

msakai commented Jul 17, 2018

I assumed the memory is owned by the model.

@okdshin okdshin added the enhancement New feature or request label Jul 17, 2018
@okdshin
Copy link
Contributor

okdshin commented Jul 17, 2018

I see. I'll modify as that.

@msakai
Copy link
Member

msakai commented Sep 10, 2018

PR #41 is related as this PR change the type of dims.

@okdshin
Copy link
Contributor

okdshin commented Jan 23, 2019

I've done.

@okdshin okdshin closed this as completed Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants