mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
feat: dot weights are signed
This commit is contained in:
@@ -247,7 +247,7 @@ impl OperationDag {
|
||||
|
||||
pub struct Weights(operator::Weights);
|
||||
|
||||
fn vector(weights: &[u64]) -> Box<Weights> {
|
||||
fn vector(weights: &[i64]) -> Box<Weights> {
|
||||
Box::new(Weights(operator::Weights::vector(weights)))
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ mod ffi {
|
||||
type Weights;
|
||||
|
||||
#[namespace = "concrete_optimizer::weights"]
|
||||
fn vector(weights: &[u64]) -> Box<Weights>;
|
||||
fn vector(weights: &[i64]) -> Box<Weights>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
|
||||
@@ -1099,7 +1099,7 @@ void concrete_optimizer$cxxbridge1$OperationDag$dump(const ::concrete_optimizer:
|
||||
|
||||
namespace weights {
|
||||
extern "C" {
|
||||
::concrete_optimizer::Weights *concrete_optimizer$weights$cxxbridge1$vector(::rust::Slice<const ::std::uint64_t> weights) noexcept;
|
||||
::concrete_optimizer::Weights *concrete_optimizer$weights$cxxbridge1$vector(::rust::Slice<const ::std::int64_t> weights) noexcept;
|
||||
} // extern "C"
|
||||
} // namespace weights
|
||||
|
||||
@@ -1172,7 +1172,7 @@ namespace dag {
|
||||
}
|
||||
|
||||
namespace weights {
|
||||
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<const ::std::uint64_t> weights) noexcept {
|
||||
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<const ::std::int64_t> weights) noexcept {
|
||||
return ::rust::Box<::concrete_optimizer::Weights>::from_raw(concrete_optimizer$weights$cxxbridge1$vector(weights));
|
||||
}
|
||||
} // namespace weights
|
||||
|
||||
@@ -1050,6 +1050,6 @@ namespace dag {
|
||||
} // namespace dag
|
||||
|
||||
namespace weights {
|
||||
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<const ::std::uint64_t> weights) noexcept;
|
||||
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<const ::std::int64_t> weights) noexcept;
|
||||
} // namespace weights
|
||||
} // namespace concrete_optimizer
|
||||
|
||||
@@ -42,7 +42,7 @@ void test_dag_no_lut() {
|
||||
|
||||
std::vector<concrete_optimizer::dag::OperatorIndex> inputs = {node1};
|
||||
|
||||
std::vector<uint64_t> weight_vec = {1, 1, 1};
|
||||
std::vector<int64_t> weight_vec = {1, 1, 1};
|
||||
|
||||
rust::cxxbridge1::Box<concrete_optimizer::Weights> weights =
|
||||
concrete_optimizer::weights::vector(slice(weight_vec));
|
||||
|
||||
Reference in New Issue
Block a user