pub struct Node { /* private fields */ }
Expand description
Node wrapper.
Implementations§
Source§impl Node
impl Node
Sourcepub fn from_proto(inner: NodeProto) -> Self
pub fn from_proto(inner: NodeProto) -> Self
Creates new node from proto.
Sourcepub fn with_name<N: Into<String>>(self, name: N) -> Self
pub fn with_name<N: Into<String>>(self, name: N) -> Self
Renames output names accordingly.
Examples found in repository?
More examples
examples/add.rs (line 20)
4fn main() {
5 let mut graph = builder::Graph::new("add");
6
7 let x = graph
8 .input("X")
9 .typed(DataType::Float)
10 .dim(1)
11 .dim(10)
12 .node();
13 let y = graph
14 .input("Y")
15 .typed(DataType::Float)
16 .dim(1)
17 .dim(10)
18 .node();
19
20 let z = (x + y).with_name("Z");
21
22 let model = graph.outputs(z).model().build();
23
24 save_model("add.onnx", &model).unwrap();
25}
Sourcepub fn abs(&self) -> Node
pub fn abs(&self) -> Node
Creates new absolute operation.
Examples found in repository?
More examples
Sourcepub fn sqrt(&self) -> Node
pub fn sqrt(&self) -> Node
Creates new square root operation.
Examples found in repository?
More examples
Sourcepub fn pow<T: Into<String>>(&self, power: T) -> Node
pub fn pow<T: Into<String>>(&self, power: T) -> Node
Creates new power operation.
Examples found in repository?
More examples
Sourcepub fn sum<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
pub fn sum<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
Creates new reduce sum operation.
Sourcepub fn max<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
pub fn max<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
Creates new reduce max operation.
Sourcepub fn mean<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
pub fn mean<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
Creates new reduce mean operation.
Examples found in repository?
More examples
Sourcepub fn min<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
pub fn min<A: Into<Axes>>(&self, axes: A, keepdims: bool) -> Node
Creates new reduce min operation.
Sourcepub fn equal<Rhs: Into<String>>(&self, right: Rhs) -> Node
pub fn equal<Rhs: Into<String>>(&self, right: Rhs) -> Node
Creates new equal comparison operation.
Sourcepub fn greater<Rhs: Into<String>>(&self, right: Rhs) -> Node
pub fn greater<Rhs: Into<String>>(&self, right: Rhs) -> Node
Creates new greater comparison operation.
Trait Implementations§
Source§impl AsRef<Node> for ReduceMean
impl AsRef<Node> for ReduceMean
Source§impl Into<Node> for ReduceMean
impl Into<Node> for ReduceMean
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl !Send for Node
impl !Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more