diff options
author | zachcp <zachcp@users.noreply.github.com> | 2024-11-11 16:13:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-11 22:13:52 +0100 |
commit | 37692065837b2d635d2eb9e7ce3e4e1d439f7028 (patch) | |
tree | 6259871da1378adfc43b242b15c967c767819bcd /candle-nn | |
parent | e2b6b367fa852ed30ac532f8d77cd8479c7ed092 (diff) | |
download | candle-37692065837b2d635d2eb9e7ce3e4e1d439f7028.tar.gz candle-37692065837b2d635d2eb9e7ce3e4e1d439f7028.tar.bz2 candle-37692065837b2d635d2eb9e7ce3e4e1d439f7028.zip |
Update docs (#2553)
* add module docs for candle-core
* doc each of the candle-nn modules and add the links to the doc page
Diffstat (limited to 'candle-nn')
-rw-r--r-- | candle-nn/src/activation.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/kv_cache.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/lib.rs | 17 | ||||
-rw-r--r-- | candle-nn/src/loss.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/ops.rs | 3 | ||||
-rw-r--r-- | candle-nn/src/rotary_emb.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/sequential.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/var_builder.rs | 2 | ||||
-rw-r--r-- | candle-nn/src/var_map.rs | 2 |
9 files changed, 34 insertions, 0 deletions
diff --git a/candle-nn/src/activation.rs b/candle-nn/src/activation.rs index fc1819f5..772548a0 100644 --- a/candle-nn/src/activation.rs +++ b/candle-nn/src/activation.rs @@ -1,3 +1,5 @@ +//! Activation Functions +//! use candle::{Result, Tensor}; use serde::Deserialize; diff --git a/candle-nn/src/kv_cache.rs b/candle-nn/src/kv_cache.rs index 68addb98..918dca70 100644 --- a/candle-nn/src/kv_cache.rs +++ b/candle-nn/src/kv_cache.rs @@ -1,3 +1,5 @@ +//! Cache Implementations +//! use candle::{Device, Result, Tensor}; #[derive(Debug, Clone)] diff --git a/candle-nn/src/lib.rs b/candle-nn/src/lib.rs index fcac5830..eb3cde4a 100644 --- a/candle-nn/src/lib.rs +++ b/candle-nn/src/lib.rs @@ -1,3 +1,20 @@ +//! candle-nn +//! +//! ## Other Crates +//! +//! Candle consists of a number of crates. This crate holds structs and functions +//! that allow you to build and train neural nets. You may wish +//! to look at the docs for the other crates which can be found here: +//! +//! - [candle-core](https://docs.rs/candle-core/). Core Datastructures and DataTypes. +//! - [candle-nn](https://docs.rs/candle-nn/). Building blocks for Neural Nets. +//! - [candle-datasets](https://docs.rs/candle-datasets/). Rust access to commonly used Datasets like MNIST. +//! - [candle-examples](https://docs.rs/candle-examples/). Examples of Candle in Use. +//! - [candle-onnx](https://docs.rs/candle-onnx/). Loading and using ONNX models. +//! - [candle-pyo3](https://docs.rs/candle-pyo3/). Access to Candle from Python. +//! - [candle-transformers](https://docs.rs/candle-transformers/). Candle implemntation of many published transformer models. +//! + pub mod activation; pub mod batch_norm; pub mod conv; diff --git a/candle-nn/src/loss.rs b/candle-nn/src/loss.rs index fb1e11f4..03e8524d 100644 --- a/candle-nn/src/loss.rs +++ b/candle-nn/src/loss.rs @@ -1,3 +1,5 @@ +//! Loss Calculations +//! use candle::{Result, Tensor}; /// The negative log likelihood loss. diff --git a/candle-nn/src/ops.rs b/candle-nn/src/ops.rs index 0f35285d..c84e297b 100644 --- a/candle-nn/src/ops.rs +++ b/candle-nn/src/ops.rs @@ -1,3 +1,6 @@ +//! Tensor ops. +//! + use candle::{CpuStorage, DType, Layout, Module, Result, Shape, Tensor, D}; use rayon::prelude::*; diff --git a/candle-nn/src/rotary_emb.rs b/candle-nn/src/rotary_emb.rs index 1084cfb5..0191bd7e 100644 --- a/candle-nn/src/rotary_emb.rs +++ b/candle-nn/src/rotary_emb.rs @@ -1,3 +1,5 @@ +//! Rotary Embeddings +//! use candle::{CpuStorage, Layout, Result, Shape, Tensor, D}; use rayon::prelude::*; diff --git a/candle-nn/src/sequential.rs b/candle-nn/src/sequential.rs index bef99752..de5ae497 100644 --- a/candle-nn/src/sequential.rs +++ b/candle-nn/src/sequential.rs @@ -1,3 +1,5 @@ +//! Sequential Layer +//! //! A sequential layer used to chain multiple layers and closures. use candle::{Module, Result, Tensor}; diff --git a/candle-nn/src/var_builder.rs b/candle-nn/src/var_builder.rs index 00669468..0d836c7f 100644 --- a/candle-nn/src/var_builder.rs +++ b/candle-nn/src/var_builder.rs @@ -1,3 +1,5 @@ +//! A `VarBuilder` for variable retrieval from models +//! //! A `VarBuilder` is used to retrieve variables used by a model. These variables can either come //! from a pre-trained checkpoint, e.g. using `VarBuilder::from_mmaped_safetensors`, or initialized //! for training, e.g. using `VarBuilder::from_varmap`. diff --git a/candle-nn/src/var_map.rs b/candle-nn/src/var_map.rs index 3cb27c63..ba020746 100644 --- a/candle-nn/src/var_map.rs +++ b/candle-nn/src/var_map.rs @@ -1,3 +1,5 @@ +//! A `VarMap` is a store that holds named variables. +//! use candle::{DType, Device, Result, Shape, Tensor, Var}; use std::collections::HashMap; use std::sync::{Arc, Mutex}; |