Skip to content

Commit

Permalink
More unused fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Nov 15, 2024
1 parent 3c16d72 commit 428f19f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion candle-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ intel-mkl-src = { workspace = true, optional = true }
num-traits = { workspace = true }
palette = { version = "0.7.6", optional = true }
enterpolation = { version = "0.2.1", optional = true}
pyo3 = { version = "0.22.0", features = ["auto-initialize"], optional = true }
pyo3 = { version = "0.22.0", features = ["auto-initialize", "abi3-py311"], optional = true }
rayon = { workspace = true }
rubato = { version = "0.15.0", optional = true }
safetensors = { workspace = true }
Expand Down
7 changes: 5 additions & 2 deletions candle-examples/examples/reinforcement-learning/ddpg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ fn track(
Ok(())
}

#[allow(unused)]
struct Actor<'a> {
varmap: VarMap,
vb: VarBuilder<'a>,
Expand Down Expand Up @@ -210,7 +211,7 @@ impl Actor<'_> {
let target_network = make_network("target-actor")?;

// this sets the two networks to be equal to each other using tau = 1.0
track(&mut varmap, &vb, "target-actor", "actor", &dims, 1.0);
track(&mut varmap, &vb, "target-actor", "actor", &dims, 1.0)?;

Ok(Self {
varmap,
Expand Down Expand Up @@ -243,6 +244,7 @@ impl Actor<'_> {
}
}

#[allow(unused)]
struct Critic<'a> {
varmap: VarMap,
vb: VarBuilder<'a>,
Expand Down Expand Up @@ -286,7 +288,7 @@ impl Critic<'_> {
let target_network = make_network("target-critic")?;

// this sets the two networks to be equal to each other using tau = 1.0
track(&mut varmap, &vb, "target-critic", "critic", &dims, 1.0);
track(&mut varmap, &vb, "target-critic", "critic", &dims, 1.0)?;

Ok(Self {
varmap,
Expand Down Expand Up @@ -321,6 +323,7 @@ impl Critic<'_> {
}
}

#[allow(unused)]
#[allow(clippy::upper_case_acronyms)]
pub struct DDPG<'a> {
actor: Actor<'a>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
use candle::{DType, Device, Result, Tensor};
use pyo3::prelude::*;

#[allow(unused)]
#[derive(Debug)]
pub struct Step {
pub obs: Tensor,
pub reward: Tensor,
pub is_done: Tensor,
}

#[allow(unused)]
pub struct VecGymEnv {
env: PyObject,
action_space: usize,
Expand All @@ -19,6 +21,7 @@ fn w(res: PyErr) -> candle::Error {
candle::Error::wrap(res)
}

#[allow(unused)]
impl VecGymEnv {
pub fn new(name: &str, img_dir: Option<&str>, nprocesses: usize) -> Result<VecGymEnv> {
Python::with_gil(|py| {
Expand Down
2 changes: 1 addition & 1 deletion candle-pyo3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ candle-nn = { workspace = true }
candle-onnx = { workspace = true, optional = true }
half = { workspace = true }
intel-mkl-src = { workspace = true, optional = true }
pyo3 = { version = "0.22.0", features = ["extension-module", "abi3-py38"] }
pyo3 = { version = "0.22.0", features = ["extension-module", "abi3-py311"] }

[build-dependencies]
pyo3-build-config = "0.22"
Expand Down

0 comments on commit 428f19f

Please sign in to comment.