pub struct GraphProgramInput { /* private fields */ }Expand description
A single ordered input required by a GraphProgram.
§Examples
use tenferro_runtime::{GraphCompiler, TracedTensor};
let x = TracedTensor::from_vec_col_major(vec![2], vec![1.0_f64, 2.0]).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&x.neg()).unwrap();
let input = &program.input_specs()[0];
assert_eq!(input.shape(), &[2]);Implementations§
Source§impl GraphProgramInput
impl GraphProgramInput
Sourcepub fn dtype(&self) -> DType
pub fn dtype(&self) -> DType
Return the dtype expected for this input.
§Examples
use tenferro_runtime::{DType, GraphCompiler, TracedTensor};
let x = TracedTensor::input_symbolic_shape(DType::F64, 1).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler
.compile_with_input_specs(&x, &[(&x, DType::F64, &[2])])
.unwrap();
assert_eq!(program.input_specs()[0].dtype(), DType::F64);Sourcepub fn shape(&self) -> &[usize]
pub fn shape(&self) -> &[usize]
Return the concrete shape expected for this input.
§Examples
use tenferro_runtime::{GraphCompiler, TracedTensor};
let x = TracedTensor::from_vec_col_major(vec![2], vec![1.0_f64, 2.0]).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&x).unwrap();
assert_eq!(program.input_specs()[0].shape(), &[2]);Trait Implementations§
Source§impl Clone for GraphProgramInput
impl Clone for GraphProgramInput
Source§fn clone(&self) -> GraphProgramInput
fn clone(&self) -> GraphProgramInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GraphProgramInput
impl !RefUnwindSafe for GraphProgramInput
impl Send for GraphProgramInput
impl Sync for GraphProgramInput
impl Unpin for GraphProgramInput
impl UnsafeUnpin for GraphProgramInput
impl !UnwindSafe for GraphProgramInput
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