file_path stringlengths 7 180 | content stringlengths 0 811k | repo stringclasses 11
values |
|---|---|---|
src/operators/tensor/math/less_equal.cairo | use orion::operators::tensor::{core::{Tensor, TensorTrait, unravel_index}, I32Tensor};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::less_equal docstring
fn less_equal<
T,
impl TPartialOrd: PartialOrd<T>,
i... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/log.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::log docstring
fn log<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TTensor: TensorTrait<T>,
impl TCopy: Copy<T>,
impl TDrop... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/max.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::max docstring
fn max<
T,
MAG,
impl TTensorTrait: Tens... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/max_in_tensor.cairo | use orion::numbers::NumberTrait;
/// Cf: TensorTrait::max_in_tensor docstring
fn max_in_tensor<
T,
MAG,
impl TNumber: NumberTrait<T, MAG>,
impl TPartialOrd: PartialOrd<T>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>
>(
mut vec: Span::<T>
) -> T {
let mut max_value: T = NumberTrait::min_val... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/min.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::min docstring
fn min<
T,
MAG,
impl TTensorTrait: Tens... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/min_in_tensor.cairo | use orion::numbers::NumberTrait;
/// Cf: TensorTrait::min_in_tensor docstring
fn min_in_tensor<
T,
MAG,
impl TNumber: NumberTrait<T, MAG>,
impl TPartialOrd: PartialOrd<T>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>
>(
mut vec: Span::<T>
) -> T {
let mut min_value: T = NumberTrait::max_val... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/neg.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::neg docstring
fn neg<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>
>(
mut z: Tensor<T>
) -> Tensor<T> {
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/not.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::operators::tensor::implementations::{tensor_bool::BoolTensor};
// Cf TensorTrait::not docstring
fn not(mut z: Tensor<bool>) -> Tensor<bool> {
let mut data_result: Array<bool> = array![];
loop {
match... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/onehot.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::{TensorTrait, Tensor};
/// Cf: TensorTrait::onehot docstring
fn onehot_encode<
T,
MAG,
impl FFixed: FixedTrait<T, MAG>,
impl FTensorTrait: TensorTrait<T>,
impl FNumber: NumberTrait<T, M... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/optional_get_element.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::optional_get_element docstring
fn optional_get_element<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>
>(
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/or.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::or docstring
fn or<
T,
MAG,
impl TNumber: NumberTrait... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/pow.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{broadcast_shape, broadcast_index_mapping, len_from_shape};
/// Cf: TensorTrait::pow docstring
fn pow<
T,
MAG,
impl TNumber: NumberTrait<T, MAG>,
impl TTenso... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/random_uniform_like.cairo | use core::integer;
use alexandria_merkle_tree::merkle_tree::{pedersen::PedersenHasherImpl};
use orion::numbers::fixed_point::core::FixedTrait;
use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::operators::tensor::helpers::{reduce_output_shape, len_from_shape, combin... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/range.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
fn range<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumber: NumberTrait<T, MAG>,
impl TAdd: Add<T>,
impl TSub: Sub<T>,
impl TMul: Mul<T>,
impl TPartialOrd: PartialOrd<T>,
impl TAddEq: AddEq... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_l1.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
/// Cf: TensorTrait::reduce_sum docstring
fn reduce_l1<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumber: NumberTrait<T, MAG>,
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_l2.cairo | use core::debug::PrintTrait;
use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
fn square<
T,
MAG,
impl TTensorTrait: TensorTrait<T>,
impl TNumber: NumberTrait<T, MAG>,
impl TMul... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_log_sum.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
/// Cf: TensorTrait::reduce_sum_square docstring
fn reduce_log_sum<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumber: NumberTrait<... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_log_sum_exp.cairo | use core::option::OptionTrait;
use core::array::ArrayTrait;
use core::array::SpanTrait;
use core::debug::PrintTrait;
use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::m... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_mean.cairo | use alexandria_sorting::bubble_sort;
use alexandria_data_structures::array_ext::{SpanTraitExt};
use orion::numbers::fixed_point::core::FixedTrait;
use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
use orion::operators::tensor::helpers::{
reduce_... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_min.cairo | use alexandria_sorting::bubble_sort;
use alexandria_data_structures::array_ext::{SpanTraitExt};
use orion::numbers::fixed_point::core::FixedTrait;
use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
use orion::operators::tensor::helpers::{
reduce_... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_prod.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
use orion::operators::tensor::helpers::{reduce_output_shape, len_from_shape, combine_indices};
/// reduce_prod - Reduces a tensor to its products along specified axis.
fn reduce_prod<
T,
MAG,... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_sum.cairo | use core::option::OptionTrait;
use core::traits::TryInto;
use alexandria_sorting::bubble_sort;
use alexandria_data_structures::array_ext::{SpanTraitExt};
use orion::numbers::fixed_point::core::FixedTrait;
use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_in... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/reduce_sum_square.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, ravel_index, unravel_index};
use orion::numbers::fixed_point::core::FixedTrait;
fn square<
T,
MAG,
impl FTensorTrait: TensorTrait<T>,
impl FNumber: NumberTrait<T, MAG>,
impl TMul: Mul<T>,
impl FCopy: Copy... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/resize.cairo | use alexandria_sorting::bubble_sort;
use orion::numbers::NumberTrait;
use orion::operators::tensor::{
TensorTrait, Tensor, I8Tensor, I32Tensor, U32Tensor, FP16x16Tensor, BoolTensor
};
use orion::numbers::{FP16x16, FP16x16Impl, FP32x32, FP32x32Impl, FixedTrait};
#[derive(Copy, Drop)]
enum MODE {
NEAREST,
L... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/round.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
fn round<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl FTensor: TensorTrait<T>,
impl FCopy: Copy<T>,
impl FDrop: Drop<T>
>(
mut self: Tensor<T>
) -> Tensor<T> {
let mut result: Array<T> =... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/scatter.cairo | use alexandria_data_structures::array_ext::SpanTraitExt;
use orion::numbers::NumberTrait;
use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};
use core::dict::Felt252DictTrait;
use core::nullable::{nullable_from_box, match_nullable, FromNullableResult};
/// Cf: TensorTrait::scatter docstring
fn scatter<
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/scatter_nd.cairo | use core::nullable::{nullable_from_box, match_nullable, FromNullableResult};
use alexandria_data_structures::array_ext::SpanTraitExt;
use orion::numbers::NumberTrait;
use orion::operators::tensor::{TensorTrait, Tensor, U32Tensor};
/// Cf: TensorTrait::scatter_nd docstring
fn scatter_nd<
T,
impl TTensorTrait:... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/shrink.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::shrink docstring
fn shrink<
T,
MAG,
impl TTensor: TensorTrait<T>,
impl TNumber: NumberTrait<T, MAG>,
impl TPartialOrd: PartialOrd<T>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>
>(
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/sign.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
fn sign<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl FTensor: TensorTrait<T>,
impl FCopy: Copy<T>,
impl FDrop: Drop<T>,
>(
mut self: Tensor<T>
) -> Tensor<T> {
let mut result: Array<T> =... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/sin.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::sin docstring
fn sin<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TTensor: TensorTrait<T>,
impl TCopy: Copy<T>,
impl TDrop... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/sinh.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::sinh docstring
fn sinh<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TTensor: TensorTrait<T>,
impl TCopy: Copy<T>,
impl TDr... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/sqrt.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
fn sqrt<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TTensor: TensorTrait<T>,
impl TCopy: Copy<T>,
impl TDrop: Drop<T>,
>(
mut self: Tensor... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/tanh.cairo | use orion::numbers::NumberTrait;
use orion::numbers::fixed_point::core::FixedTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
/// Cf: TensorTrait::tanh docstring
fn tanh<
T,
MAG,
impl TNumberTrait: NumberTrait<T, MAG>,
impl TTensor: TensorTrait<T>,
impl TCopy: Copy<T>,
impl TDr... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/where.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::where docstring
fn where<
T,
MAG,
impl TNumber: Numbe... | https://github.com/gizatechxyz/orion |
src/operators/tensor/math/xor.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait, unravel_index};
use orion::operators::tensor::helpers::{
broadcast_shape, broadcast_index_mapping, len_from_shape, check_compatibility
};
/// Cf: TensorTrait::xor docstring
fn xor<
T,
MAG,
impl TNumber: NumberTra... | https://github.com/gizatechxyz/orion |
src/operators/tensor/ml.cairo | mod array_feature_extractor;
mod label_encoder;
| https://github.com/gizatechxyz/orion |
src/operators/tensor/ml/array_feature_extractor.cairo | use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::numbers::NumberTrait;
/// Cf: TensorTrait::array_feature_extractor docstring
fn array_feature_extractor<
T, impl TTensor: TensorTrait<T>, impl TCopy: Copy<T>, impl TDrop: Drop<T>
>(
self: Tensor<T>, indices: Tensor<usize>
) -> Tensor<T> {
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/ml/label_encoder.cairo | use core::array::ArrayTrait;
use core::option::OptionTrait;
use core::array::SpanTrait;
use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::numbers::NumberTrait;
use core::dict::Felt252DictTrait;
use core::nullable::{nullable_from_box, match_nullable, FromNullableResult};
use core::debug::PrintTrait... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization.cairo | mod quantize_linear;
mod dynamic_quantize_linear;
mod dequantize_linear;
mod qlinear_matmul;
mod qlinear_concat;
mod qlinear_add;
mod qlinear_mul;
mod qlinear_leakyrelu;
| https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/dequantize_linear.cairo | use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::operators::tensor::helpers::check_compatibility;
use orion::utils::saturate;
/// Cf: PerfomanceTrait::dequantize_linear docstring
fn dequantize_linear<
Q,
T,
impl TTensor: TensorTrait<T>,
impl QIntoT: Into<Q, T>,
impl TSub: Sub<T... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/dynamic_quantize_linear.cairo | use orion::numbers::NumberTrait;
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::utils::saturate;
fn dynamic_quantize_linear<
T,
Q,
... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/qlinear_add.cairo | use orion::numbers::{NumberTrait};
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
fn qlinear_add<
T,
MAG,
Q,
impl TTensor: TensorTrait<T>... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/qlinear_concat.cairo | use orion::numbers::{NumberTrait};
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::math::concat::{
validate_shapes, compu... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/qlinear_leakyrelu.cairo | use orion::numbers::{NumberTrait};
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
fn qlinear_leakyrelu<
T,
MAG,
Q,
impl TTensor: TensorTr... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/qlinear_matmul.cairo | use orion::numbers::{NumberTrait};
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
/// Cf: TensorTrait::qlinear_matmul docstring
fn qlinear_matmul<
T,... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/qlinear_mul.cairo | use orion::numbers::{NumberTrait};
use orion::operators::tensor::quantization::dequantize_linear::dequantize_linear;
use orion::operators::tensor::quantization::quantize_linear::quantize_linear;
use orion::operators::tensor::{TensorTrait, Tensor};
fn qlinear_mul<
T,
MAG,
Q,
impl TTensor: TensorTrait<T... | https://github.com/gizatechxyz/orion |
src/operators/tensor/quantization/quantize_linear.cairo | use orion::operators::tensor::core::{Tensor, TensorTrait};
use orion::operators::tensor::helpers::check_compatibility;
use orion::operators::tensor::math::arithmetic::saturated_add;
use orion::utils::saturate;
/// Cf: TensorTrait::quantize_linear docstring
fn quantize_linear<
T,
Q,
impl TTensor: TensorTrai... | https://github.com/gizatechxyz/orion |
src/operators/vec.cairo | use core::box::BoxTrait;
use core::traits::Into;
use core::nullable::{Nullable, match_nullable, FromNullableResult, nullable_from_box};
use alexandria_data_structures::vec::{VecTrait};
use orion::numbers::NumberTrait;
struct NullableVec<T> {
items: Felt252Dict<Nullable<T>>,
len: usize,
}
impl DestructNullable... | https://github.com/gizatechxyz/orion |
src/test_helper.cairo | mod tensor;
| https://github.com/gizatechxyz/orion |
src/test_helper/tensor.cairo | mod fixed_point;
mod i32;
mod i8;
mod u32;
| https://github.com/gizatechxyz/orion |
src/test_helper/tensor/fixed_point.cairo | mod fp8x23;
mod fp16x16;
| https://github.com/gizatechxyz/orion |
src/test_helper/tensor/fixed_point/fp16x16.cairo | use orion::numbers::fixed_point::core::{FixedTrait};
use orion::numbers::fixed_point::implementations::fp16x16::core::FP16x16;
use orion::operators::tensor::implementations::tensor_fp16x16::FP16x16Tensor;
use orion::operators::tensor::{TensorTrait, Tensor};
// 1D
fn fp_tensor_1x3_helper() -> Tensor<FP16x16> {
let ... | https://github.com/gizatechxyz/orion |
src/test_helper/tensor/fixed_point/fp8x23.cairo | use orion::numbers::fixed_point::core::{FixedTrait};
use orion::numbers::fixed_point::implementations::fp8x23::core::FP8x23;
use orion::operators::tensor::implementations::tensor_fp8x23::FP8x23Tensor;
use orion::operators::tensor::{TensorTrait, Tensor};
// 1D
fn fp_tensor_1x3_helper() -> Tensor<FP8x23> {
let mut s... | https://github.com/gizatechxyz/orion |
src/test_helper/tensor/i32.cairo | use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I32Tensor;
// 1D
fn i32_tensor_1x3_helper() -> Tensor<i32> {
let mut sizes: Array<u32> = array![3];
let mut data: Array<i32> = array![0, 1, 2];
let tensor = TensorTrait::new(sizes.span(), data.span());
tensor
}
fn i32... | https://github.com/gizatechxyz/orion |
src/test_helper/tensor/i8.cairo | use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I8Tensor;
// 1D
fn i8_tensor_1x3_helper() -> Tensor<i8> {
let mut sizes: Array<u32> = array![3];
let mut data: Array<i8> = array![0, 1, 2];
let tensor = TensorTrait::new(sizes.span(), data.span());
tensor
}
fn i8_tens... | https://github.com/gizatechxyz/orion |
src/test_helper/tensor/u32.cairo | use orion::operators::tensor::U32Tensor;
use orion::operators::tensor::{TensorTrait, Tensor};
// 1D
fn u32_tensor_1x3_helper() -> Tensor<u32> {
let mut sizes: Array<u32> = array![3];
let mut data: Array<u32> = array![0, 1, 2];
let tensor = TensorTrait::<u32>::new(sizes.span(), data.span());
tensor
}
... | https://github.com/gizatechxyz/orion |
src/utils.cairo | use orion::operators::tensor::{Tensor, TensorTrait};
fn u32_max(a: u32, b: u32) -> u32 {
if a > b {
a
} else {
b
}
}
fn saturate<T, impl TCopy: Copy<T>, impl TDrop: Drop<T>, impl PartialOrdT: PartialOrd<T>>(
min: T, max: T, x: T
) -> T {
if x < min {
min
} else if x > m... | https://github.com/gizatechxyz/orion |
tests/lib.cairo | mod numbers;
mod performance;
mod tensor_core;
mod nodes;
mod ml;
mod operators;
| https://github.com/gizatechxyz/orion |
tests/ml.cairo | mod tree_ensemble_classifier;
mod tree_ensemble_regressor;
mod linear_regressor_test;
mod linear_classifier_test;
mod svm_regressor_test;
mod svm_classifier_test;
mod normalizer_test;
| https://github.com/gizatechxyz/orion |
tests/ml/linear_classifier_test.cairo | use orion::numbers::FP16x16;
use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor};
use orion::operators::ml::linear::linear_classifier::{
LinearClassifierTrait, POST_TRANSFORM, LinearClassifier
};
use core::debug::PrintTrait;
#[test]
#[available_gas(200000000000)]
fn test_linear_classifie... | https://github.com/gizatechxyz/orion |
tests/ml/linear_regressor_test.cairo | use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor, FP16x16TensorAdd};
use orion::operators::ml::linear::linear_regressor::{
LinearRegressorTrait, POST_TRANSFORM, LinearRegressor
};
use orion::numbers::{FP16x16, FixedTrait};
use core::debug::PrintTrait;
use orion::operators::nn::{NNTrait... | https://github.com/gizatechxyz/orion |
tests/ml/normalizer_test.cairo | use orion::operators::ml::normalizer::normalizer::{NormalizerTrait, NORM};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::numbers::FP16x16;
use orion::operators::tensor::{
Tensor, TensorTrait, FP16x16Tensor, FP16x16TensorDiv, FP16x16TensorPartialEq
};
#[test]
#[available_gas(200000000000)]
fn test_norma... | https://github.com/gizatechxyz/orion |
tests/ml/svm_classifier_test.cairo | use orion::numbers::FP16x16;
use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::numbers::FP64x64;
use orion::operators::tensor::implementations::tensor_fp64x64::{
FP64x64Tensor... | https://github.com/gizatechxyz/orion |
tests/ml/svm_regressor_test.cairo | use orion::numbers::FP16x16;
use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::ml::svm::svm_regressor::{SVMRegressorTrait, POST_TRANSFORM, SVMRegressor};
use orion::ope... | https://github.com/gizatechxyz/orion |
tests/ml/tree_ensemble_classifier.cairo | use orion::numbers::FP16x16;
use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor};
use orion::operators::ml::tree_ensemble::core::{NODE_MODES, TreeEnsembleAttributes, TreeEnsemble};
use orion::operators::ml::tree_ensemble::tree_ensemble_classifier::{
TreeEnsembleClassifier, POST_TRANSFORM, ... | https://github.com/gizatechxyz/orion |
tests/ml/tree_ensemble_regressor.cairo | use orion::numbers::FP16x16;
use orion::operators::tensor::{Tensor, TensorTrait, FP16x16Tensor, U32Tensor};
use orion::operators::ml::tree_ensemble::core::{NODE_MODES, TreeEnsembleAttributes, TreeEnsemble};
use orion::operators::ml::tree_ensemble::tree_ensemble_regressor::{
TreeEnsembleRegressor, POST_TRANSFORM, Tr... | https://github.com/gizatechxyz/orion |
tests/nodes.cairo | mod abs_fp16x16;
mod abs_fp8x23;
mod abs_i32;
mod abs_i8;
mod acos_fp16x16;
mod acos_fp8x23;
mod acosh_fp16x16;
mod acosh_fp8x23;
mod add_fp16x16;
mod add_fp16x16_broadcast;
mod add_fp8x23;
mod add_fp8x23_broadcast;
mod add_i32;
mod add_i32_broadcast;
mod add_i8;
mod add_i8_broadcast;
mod add_u32;
mod add_u32_broadcast... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp16x16.cairo | mod input_0;
mod output_0;
use orion::operators::tensor::FP16x16Tensor;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(2000000000)]
fn test_abs_f... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp16x16/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP16x16Tensor;
use orion::numbers::{FixedTrait, FP16x16};
fn input_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp16x16/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP16x16Tensor;
use orion::numbers::{FixedTrait, FP16x16};
fn output_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mu... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp8x23.cairo | mod input_0;
mod output_0;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP8x23Tensor;
use orion::operators::tensor::FP8x23TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(2000000000)]
fn test_abs_fp8... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp8x23/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP8x23Tensor;
use orion::numbers::{FixedTrait, FP8x23};
fn input_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut da... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_fp8x23/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP8x23Tensor;
use orion::numbers::{FixedTrait, FP8x23};
fn output_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut d... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i32.cairo | mod input_0;
mod output_0;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::I32Tensor;
use orion::operators::tensor::I32TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(2000000000)]
fn test_abs_i32() {
... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i32/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I32Tensor;
fn input_0() -> Tensor<i32> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut data = ArrayTrait::new();
data.append(-35);
... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i32/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I32Tensor;
fn output_0() -> Tensor<i32> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut data = ArrayTrait::new();
data.append(35);
... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i8.cairo | mod input_0;
mod output_0;
use orion::operators::tensor::I8TensorPartialEq;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::I8Tensor;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(2000000000)]
fn test_abs_i8() {
... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i8/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I8Tensor;
fn input_0() -> Tensor<i8> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut data = ArrayTrait::new();
data.append(-85);
... | https://github.com/gizatechxyz/orion |
tests/nodes/abs_i8/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::I8Tensor;
fn output_0() -> Tensor<i8> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(2);
let mut data = ArrayTrait::new();
data.append(85);
... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp16x16.cairo | mod input_0;
mod output_0;
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
use orion::utils::{assert_eq, assert_seq_eq};
#[test]
#[available_gas(200000... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp16x16/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use orion::numbers::{FixedTrait, FP16x16};
fn input_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp16x16/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use orion::numbers::{FixedTrait, FP16x16};
fn output_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.ap... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp8x23.cairo | mod input_0;
mod output_0;
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::operators::tensor::FP8x23TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
use core::array::{ArrayTrait, SpanTrait};
use orion::utils::{assert_eq, assert_seq_eq};
#[test]
#[available_gas(200000000... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp8x23/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::numbers::{FixedTrait, FP8x23};
fn input_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(... | https://github.com/gizatechxyz/orion |
tests/nodes/acos_fp8x23/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::numbers::{FixedTrait, FP8x23};
fn output_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp16x16.cairo | mod input_0;
mod output_0;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(200000... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp16x16/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use orion::numbers::{FixedTrait, FP16x16};
fn input_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp16x16/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorSub};
use orion::numbers::{FixedTrait, FP16x16};
fn output_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.ap... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp8x23.cairo | mod input_0;
mod output_0;
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::FP8x23TensorPartialEq;
use core::array::{ArrayTrait, SpanTrait};
#[test]
#[available_gas(200000000... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp8x23/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::numbers::{FixedTrait, FP8x23};
fn input_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append(... | https://github.com/gizatechxyz/orion |
tests/nodes/acosh_fp8x23/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorSub};
use orion::numbers::{FixedTrait, FP8x23};
fn output_0() -> Tensor<FP8x23> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(2);
shape.append... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16.cairo | mod input_0;
mod input_1;
mod output_0;
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use core::array::{ArrayTrait, SpanTrait};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
#[test]
#[availab... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn input_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(3);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16/input_1.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn input_1() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(3);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn output_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(3);
shape.ap... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16_broadcast.cairo | mod input_0;
mod input_1;
mod output_0;
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use core::array::{ArrayTrait, SpanTrait};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::FP16x16TensorPartialEq;
use orion::operators::tensor::{TensorTrait, Tensor};
#[test]
#[availab... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16_broadcast/input_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn input_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(3);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16_broadcast/input_1.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn input_1() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(1);
shape.app... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp16x16_broadcast/output_0.cairo | use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor};
use orion::operators::tensor::{FP16x16Tensor, FP16x16TensorAdd};
use orion::numbers::{FixedTrait, FP16x16};
fn output_0() -> Tensor<FP16x16> {
let mut shape = ArrayTrait::<usize>::new();
shape.append(3);
shape.ap... | https://github.com/gizatechxyz/orion |
tests/nodes/add_fp8x23.cairo | mod input_0;
mod input_1;
mod output_0;
use orion::operators::tensor::{FP8x23Tensor, FP8x23TensorAdd};
use orion::operators::tensor::FP8x23TensorPartialEq;
use core::array::{ArrayTrait, SpanTrait};
use orion::utils::{assert_eq, assert_seq_eq};
use orion::operators::tensor::{TensorTrait, Tensor};
#[test]
#[available_... | https://github.com/gizatechxyz/orion |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.