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

Change visibility of nn::Path::add method to public. #910

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

antoniprzybylik
Copy link
Contributor

Description

This pull request updates the visibility of the nn::Path::add method from pub(crate) to pub. The updated method signature is:

pub fn add(&self, name: &str, tensor: Tensor, trainable: bool) -> Tensor

Reason for Change

Previously, the add method was restricted to crate-level visibility (pub(crate)), which limited its usage. This change makes the method accessible outside the crate, enabling users to add existing tensors to a VarStore.

Use Case

While implementing Python bindings, I needed to add tensors from Python to VarStore. Making the add method public makes this possible.

There is no reason for this method to have visibility limited to crate.
@LaurentMazare LaurentMazare merged commit 2de026d into LaurentMazare:main Nov 18, 2024
11 of 13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants