-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #609 from gizatechxyz/develop
Merge Develop into Main
- Loading branch information
Showing
104 changed files
with
2,206 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
scarb 2.5.3 | ||
scarb 2.6.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
docs/framework/operators/tensor/tensor.reduce_sum_single_axis.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## tensor.reduce_sum_single_axis | ||
|
||
```rust | ||
fn reduce_sum_single_axis(self: @Tensor<T>, axis: usize, keepdims: bool) -> Tensor<T>; | ||
``` | ||
|
||
Reduces a tensor by summing its elements along a specified axis. | ||
|
||
## Args | ||
|
||
* `self`(`@Tensor<T>`) - The input tensor. | ||
* `axis`(`usize`) - The dimension to reduce. | ||
* `keepdims`(`bool`) - If true, retains reduced dimensions with length 1. | ||
|
||
## Panics | ||
|
||
* Panics if axis is not in the range of the input tensor's dimensions. | ||
|
||
## Returns | ||
|
||
A new `Tensor<T>` instance with the specified axis reduced by summing its elements. | ||
|
||
## Examples | ||
|
||
```rust | ||
use core::array::{ArrayTrait, SpanTrait}; | ||
|
||
use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor}; | ||
|
||
fn reduce_sum_single_axis_example() -> Tensor<u32> { | ||
let tensor = TensorTrait::<u32>::new( | ||
shape: array![2, 2, 2].span(), data: array![0, 1, 2, 3, 4, 5, 6, 7].span(), | ||
); | ||
|
||
// We can call `reduce_sum_single_axis` function as follows. | ||
return tensor.reduce_sum_single_axis(axis: 0, keepdims: false); | ||
} | ||
>>> [[4,6],[8,10]] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.