Skip to content

Commit

Permalink
Expose TensorLike and Gradients::get_ref_checked
Browse files Browse the repository at this point in the history
  • Loading branch information
coreylowman committed Aug 10, 2023
1 parent 5d7d487 commit 113e763
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tensor/gradients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<E, D: Storage<E>> Gradients<E, D> {
}

/// Returns a reference to the underlying gradient if found.
pub(crate) fn get_ref_checked<S: Shape, T>(&self, t: &Tensor<S, E, D, T>) -> Option<&D::Vec> {
pub fn get_ref_checked<S: Shape, T>(&self, t: &Tensor<S, E, D, T>) -> Option<&D::Vec> {
self.gradient_by_id.get(&t.id)
}

Expand Down
2 changes: 1 addition & 1 deletion src/tensor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mod tensor_impls;

pub(crate) use ghost::GhostTensor;
pub(crate) use storage_traits::{OneFillStorage, ZeroFillStorage};
pub(crate) use tensorlike::Tensorlike;
pub use tensorlike::Tensorlike;

pub use cpu::{Cpu, CpuError};
#[cfg(not(feature = "cuda"))]
Expand Down

0 comments on commit 113e763

Please sign in to comment.