Comment on page
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.
Orion supports Cairo and Scarb v2.3.0
Step 1: Install Cairo
Step 2: Setup Language Server
Install the Cairo 1 VS Code Extension for proper syntax highlighting and code navigation. Just follow the steps indicated here.
Step 1: Install Scarb
Step 2: Create a new Scarb project
If your
Scarb.toml
doesn't already have a [dependencies]
section, add it, then list the package name and the URL to its Git repository.Scarb.toml
[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 build
You can now use the
orion
in your files:use array::{ArrayTrait, SpanTrait};
use orion::operators::tensor::{TensorTrait, Tensor, I32Tensor};
use orion::operators::nn::{NNTrait, I32NN};
use orion::numbers::signed_integer::i32::{i32, IntegerTrait};
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);
}
Last modified 1mo ago