pub struct Value { /* private fields */ }
Expand description
Value info builder.
Implementations§
Source§impl Value
impl Value
Sourcepub fn typed<T: Into<DataType>>(self, elem_type: T) -> Self
pub fn typed<T: Into<DataType>>(self, elem_type: T) -> Self
Sets value element type.
Examples found in repository?
More examples
examples/add.rs (line 9)
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 dim<D: Into<Dimension>>(self, dim: D) -> Self
pub fn dim<D: Into<Dimension>>(self, dim: D) -> Self
Inserts value dimension.
Examples found in repository?
More examples
examples/add.rs (line 10)
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 node(self) -> Node
pub fn node(self) -> Node
Creates node for input. Requires builder to be bagged.
Examples found in repository?
More examples
examples/add.rs (line 12)
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 build(self) -> ValueInfoProto
pub fn build(self) -> ValueInfoProto
Builds the value info.
Trait Implementations§
Source§impl Into<ValueInfoProto> for Value
impl Into<ValueInfoProto> for Value
Source§fn into(self) -> ValueInfoProto
fn into(self) -> ValueInfoProto
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for Value
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl !UnwindSafe for Value
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