Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit 8ff7389

Browse files
authored
Merge pull request #554 from gizatechxyz/develop
Merge Develop into Main
2 parents 11e5799 + d4ecfdf commit 8ff7389

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

Scarb.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ homepage = "https://github.com/gizatechxyz/orion"
1010
alexandria_merkle_tree = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "01a7690" }
1111
alexandria_data_structures = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "01a7690" }
1212
alexandria_sorting = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "01a7690" }
13-
# TODO: update to https://github.com/influenceth/cubit & change rev
14-
cubit = { git = "https://github.com/akhercha/cubit.git", rev = "d3869a3" }
13+
cubit = { git = "https://github.com/influenceth/cubit.git", rev = "6275608" }
1514

1615
[scripts]
1716
sierra = "cairo-compile . -r"

src/operators/nn/functional/gemm.cairo

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alexandria_data_structures::array_ext::SpanTraitExt;
12
use core::array::SpanTrait;
23

34
use orion::numbers::NumberTrait;
@@ -48,6 +49,14 @@ fn gemm<
4849

4950
match C {
5051
Option::Some(c) => {
52+
let broadcast_c_shape = if c.shape.len() == 1 {
53+
array![1].span().concat(c.shape)
54+
} else {
55+
c.shape
56+
};
57+
58+
let c = Tensor { shape: broadcast_c_shape, data: c.data };
59+
5160
return mul_by_scalar(@A.matmul(@B), alpha) + mul_by_scalar(@c, beta);
5261
},
5362
Option::None(_) => { return mul_by_scalar(@A.matmul(@B), alpha); }

src/operators/tensor/helpers.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,4 +496,4 @@ impl SpanPartialOrd<T, +Drop<T>, +Copy<T>, +PartialEq<T>, +PartialOrd<T>> of Par
496496
fn lt(lhs: Span<T>, rhs: Span<T>) -> bool {
497497
span_cmp(lhs, rhs) < 0
498498
}
499-
}
499+
}

0 commit comments

Comments
 (0)