1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
//! Constant operation. use onnx_pb::TensorProto; use crate::{builder, node_to_inner, nodes::Node}; /// Constant node. pub struct Constant { inner: Node, } impl Constant { /// Creates new Constant operation. pub fn new<N: Into<String>, T: Into<TensorProto>>(name: N, value: T) -> Self { Constant { inner: builder::Node::new("Constant") .name(name) .attribute("value", value.into()) .build(), } } } node_to_inner!(Constant);