Get Started
In this section, we will guide you to start using Orion successfully. We will help you install Cairo 1.0 and add Orion dependency in your project.
📦 Installations
⚙️ Add orion dependency in your project
orion dependency in your projectIf your Scarb.toml doesn't already have a [dependencies] section, add it, then list the package name and the URL to its Git repository.
[dependencies]
orion = { git = "https://github.com/gizatechxyz/onnx-cairo" }Now, run scarb build, and Scarb will fetch orion dependency and all its dependencies. Then it will compile your package with all of these packages included:
scarb buildYou can now use the orion in your files:
use core::array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor, I32Tensor};
use orion::operators::nn::{NNTrait, I32NN};
fn relu_example() -> Tensor<i32> {
let tensor = TensorTrait::<i32>::new(
shape: array![2, 2].span(),
data: array![
IntegerTrait::new(1, false),
IntegerTrait::new(2, false),
IntegerTrait::new(1, true),
IntegerTrait::new(2, true),
]
.span(),
);
return NNTrait::relu(@tensor);
}🔭 Discover the Orion APIs
Last updated