Skip to content

Commit 3979b82

Browse files
Fixed ndarray deprecated warnings
1 parent 15d8eba commit 3979b82

File tree

7 files changed

+48
-31
lines changed

7 files changed

+48
-31
lines changed

Cargo.lock

+19-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ systemstat = "0.2.3"
151151
portable-atomic-util = { version = "0.2.2", features = ["alloc"] }
152152

153153
### For the main burn branch. ###
154-
cubecl = { git = "https://github.com/tracel-ai/cubecl", default-features = false, rev = "30d090c8b725e83a829a6459d9c09578d9a4ba68" }
155-
cubecl-common = { git = "https://github.com/tracel-ai/cubecl", default-features = false, rev = "30d090c8b725e83a829a6459d9c09578d9a4ba68" }
154+
cubecl = { git = "https://github.com/tracel-ai/cubecl", default-features = false, rev = "034f667da6e92a81b7da9f303e8507db944cc2a4" }
155+
cubecl-common = { git = "https://github.com/tracel-ai/cubecl", default-features = false, rev = "034f667da6e92a81b7da9f303e8507db944cc2a4" }
156156
### For local development. ###
157157
# cubecl = { path = "../cubecl/crates/cubecl" }
158158
# cubecl-common = { path = "../cubecl/crates/cubecl-common" }

crates/burn-ndarray/src/ops/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ fn arg<E: NdArrayElement, const D: usize>(
612612
idx as i64
613613
});
614614

615-
let output = output.into_shape(Dim(reshape.as_slice())).unwrap();
615+
let output = output.into_shape_with_order(Dim(reshape.as_slice())).unwrap();
616616

617617
NdArrayTensor {
618618
array: output.into_shared(),

crates/burn-ndarray/src/ops/conv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub(crate) fn conv2d<E: FloatNdArrayElement, Q: QuantElement>(
209209
});
210210

211211
let output = output
212-
.into_shape([batch_size, out_channels, out_height, out_width])
212+
.into_shape_with_order([batch_size, out_channels, out_height, out_width])
213213
.unwrap()
214214
.into_dyn()
215215
.into_shared();
@@ -437,7 +437,7 @@ pub(crate) fn conv3d<E: FloatNdArrayElement, Q: QuantElement>(
437437
});
438438

439439
let output = output
440-
.into_shape([batch_size, out_channels, out_depth, out_height, out_width])
440+
.into_shape_with_order([batch_size, out_channels, out_depth, out_height, out_width])
441441
.unwrap()
442442
.into_dyn()
443443
.into_shared();

crates/burn-ndarray/src/tensor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ macro_rules! reshape {
7070
let dim = $crate::to_typed_dims!($n, $shape.dims, justdim);
7171
let array: ndarray::ArcArray<$ty, Dim<[usize; $n]>> = match $array.is_standard_layout() {
7272
true => $array
73-
.into_shape(dim)
73+
.into_shape_with_order(dim)
7474
.expect("Safe to change shape without relayout")
7575
.into_shared(),
76-
false => $array.reshape(dim),
76+
false => $array.into_shape_with_order(dim).unwrap(),
7777
};
7878
let array = array.into_dyn();
7979

crates/burn-no-std-tests/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Shell commands to build and test the package:
1212
```sh
1313

1414
# install the new targets if not installed previously
15+
rustup target add thumbv6m-none-eabi
1516
rustup target add thumbv7m-none-eabi
1617
rustup target add wasm32-unknown-unknown
1718

1819
# build for various targets
1920
cargo build # regular build
2021
cargo build --target thumbv7m-none-eabi
2122
cargo build --target wasm32-unknown-unknown
23+
RUSTFLAGS="--cfg portable_atomic_unsafe_assume_single_core" cargo build --target thumbv6m-none-eabi
2224

2325
# test
2426
cargo test

examples/onnx-inference-rp2040/Cargo.lock

+20-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)