+
Skip to content

Fixing cargo doc warnings #473

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

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mod cuda {
println!("cargo:warning=Found kernels {kernel_paths:?}");
println!("cargo:warning=Found include directories {include_directories:?}");

#[allow(unused)]
let include_options: Vec<String> = include_directories
.into_iter()
.map(|s| "-I".to_string() + &s.into_os_string().into_string().unwrap())
Expand Down
2 changes: 1 addition & 1 deletion src/data/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<I: Iterator> Iterator for Batcher<usize, I> {
/// Create batches of items from an [Iterator]
pub trait IteratorBatchExt: Iterator {
/// Return an [Iterator] where the items are either:
/// - `[Self::Item; N]`, if `Size` is [Const<N>]
/// - `[Self::Item; N]`, if `Size` is [`Const<N>`]
/// - `Vec<Self::Item>`, if `Size` is [usize].
///
/// **Drop last is not supported - always returns exact batches**
Expand Down
2 changes: 1 addition & 1 deletion src/data/one_hot_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub trait OneHotEncode<E: Dtype>: DeviceStorage + ZerosTensor<E> + CopySlice<E>
///
/// Arguments:
/// - `n` - the numnber of classes to use to encode, can be `Const` or `usize`
/// - `class_labels` - either an array [usize; N], or Vec<usize>
/// - `class_labels` - either an array `[usize; N]`, or `Vec<usize>`
///
/// Const class labels and const n:
/// ```rust
Expand Down
7 changes: 0 additions & 7 deletions src/gradients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ use crate::unique_id::{HasUniqueId, UniqueId};
/// 2. Remove entries
/// 3. Access references to arrays
/// 4. Access mutable references to arrays
///
/// This structure is similar to a HashMap, where all the methods require a key
/// implementing [UniqueId], [AllocGrad].
///
/// Under the hood, it actually is a HashMap, and stores values as Box<dyn Any>. The
/// important part of key's implementing [HasShape], and [HasDtype] is that the associated type
/// of that trait is used to downcast the box to the expected value.
#[derive(Debug, Default)]
pub struct Gradients {
gradient_by_id: HashMap<UniqueId, Box<dyn std::any::Any>>,
Expand Down
2 changes: 1 addition & 1 deletion src/nn/tensor_collection/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<S: Shape, E: Dtype, D: DeviceStorage> TensorCollection<E, D> for Tensor<S,
}
}

/// Options to change behavior of [TensorVisitor]
/// Options to change behavior of [ModuleVisitor]
#[non_exhaustive]
pub struct TensorOptions<S: Shape, E: Dtype, D: DeviceStorage> {
/// Whether the tensor should be updated with gradients
Expand Down
2 changes: 1 addition & 1 deletion src/nn/tensor_collection/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct RecursiveWalker<'a, M, F> {

/// Something that can visit [Tensor]s. Used in conjunction with [RecursiveWalker].
pub trait TensorVisitor<E: Dtype, D: DeviceStorage> {
/// The type of tensor this struct uses. E.g. [TensorMut], or [TensorRef]
/// The type of tensor this struct uses. E.g. [ViewTensorMut], or [ViewTensorRef]
type Viewer: TensorViewer;
type Err;

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载