Skip to content

Commit

Permalink
refactor doc
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelDkhn committed Mar 25, 2024
1 parent f9d0603 commit dc1dc2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions docs/framework/operators/tensor/tensor.less.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#tensor.less

```rust
fn less(self: @Tensor<T>, other: @Tensor<T>) -> Tensor<bool>;
fn less(self: @Tensor<T>, other: @Tensor<T>) -> Tensor<i32>;
```

Check if each element of the first tensor is less than the corresponding element of the second tensor.
Expand Down Expand Up @@ -31,7 +31,7 @@ use core::array::{ArrayTrait, SpanTrait};

use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};

fn less_example() -> Tensor<usize> {
fn less_example() -> Tensor<i32> {
let tensor_1 = TensorTrait::<u32>::new(
shape: array![3, 3, 3].span(), data: array![0, 1, 2, 3, 4, 5, 6, 7, 8].span(),
);
Expand All @@ -43,7 +43,7 @@ fn less_example() -> Tensor<usize> {
// We can call `less` function as follows.
return tensor_1.less(@tensor_2);
}
>>> [false,false,false,false,false,false,true,false,false]
>>> [0,0,0,0,0,0,1,0,0]
```

Case 2: Compare tensors with different shapes
Expand All @@ -53,7 +53,7 @@ use core::array::{ArrayTrait, SpanTrait};

use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};

fn less_example() -> Tensor<usize> {
fn less_example() -> Tensor<i32> {
let tensor_1 = TensorTrait::<u32>::new(
shape: array![3, 3, 3].span(), data: array![0, 1, 2, 3, 4, 5, 6, 7, 8].span(),
);
Expand All @@ -63,5 +63,5 @@ fn less_example() -> Tensor<usize> {
// We can call `less` function as follows.
return tensor_1.less(@tensor_2);
}
>>> [false,false,false,false,false,false,false,true,true]
>>> [0,0,0,0,0,0,0,1,1]
```
10 changes: 5 additions & 5 deletions src/operators/tensor/core.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ trait TensorTrait<T> {
/// #tensor.less
///
/// ```rust
/// fn less(self: @Tensor<T>, other: @Tensor<T>) -> Tensor<bool>;
/// fn less(self: @Tensor<T>, other: @Tensor<T>) -> Tensor<i32>;
/// ```
///
/// Check if each element of the first tensor is less than the corresponding element of the second tensor.
Expand Down Expand Up @@ -1282,7 +1282,7 @@ trait TensorTrait<T> {
///
/// use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};
///
/// fn less_example() -> Tensor<usize> {
/// fn less_example() -> Tensor<i32> {
/// let tensor_1 = TensorTrait::<u32>::new(
/// shape: array![3, 3, 3].span(), data: array![0, 1, 2, 3, 4, 5, 6, 7, 8].span(),
/// );
Expand All @@ -1294,7 +1294,7 @@ trait TensorTrait<T> {
/// // We can call `less` function as follows.
/// return tensor_1.less(@tensor_2);
/// }
/// >>> [false,false,false,false,false,false,true,false,false]
/// >>> [0,0,0,0,0,0,1,0,0]
/// ```
///
/// Case 2: Compare tensors with different shapes
Expand All @@ -1304,7 +1304,7 @@ trait TensorTrait<T> {
///
/// use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};
///
/// fn less_example() -> Tensor<usize> {
/// fn less_example() -> Tensor<i32> {
/// let tensor_1 = TensorTrait::<u32>::new(
/// shape: array![3, 3, 3].span(), data: array![0, 1, 2, 3, 4, 5, 6, 7, 8].span(),
/// );
Expand All @@ -1314,7 +1314,7 @@ trait TensorTrait<T> {
/// // We can call `less` function as follows.
/// return tensor_1.less(@tensor_2);
/// }
/// >>> [false,false,false,false,false,false,false,true,true]
/// >>> [0,0,0,0,0,0,0,1,1]
/// ```
///
fn less(self: @Tensor<T>, other: @Tensor<T>) -> Tensor<i32>;
Expand Down

0 comments on commit dc1dc2a

Please sign in to comment.