fn infer(
        &self,
        inputs: TVec<&TensorFact>,
        outputs: TVec<&TensorFact>,
    ) -> TractResult<(TVec<TensorFact>, TVec<TensorFact>)> {
        let (infered_inputs, infered_outputs) = self.infer_facts(inputs, outputs)?;

        if let Some(stateless) = self.as_stateless() {
            if infered_inputs.iter().all(|i| i.value.is_concrete()) {
                let input_values = infered_inputs
                    .iter()
                    .map(|i| i.value.concretize().unwrap().clone().into())
                    .collect(); // checked
                let output_values = stateless
                    .eval(input_values)?
                    .into_iter()
                    .map(|t| t.into())
                    .collect::<TVec<_>>();
                return Ok((infered_inputs, output_values));
            }
        }

        Ok((infered_inputs, infered_outputs))
    }
/// Infers properties about the input and output tensors.
///
/// The `inputs` and `outputs` arguments correspond to properties about
/// the input and output tensors that are already known.
///
/// Returns Err in case of an unrecoverable error during the inference,
/// and the refined properties about the inputs and outputs otherwise.
Infers properties about the input and output tensors.
The `inputs` and `outputs` arguments correspond to properties about
the input and output tensors that are already known.

Returns Err in case of an unrecoverable error during the inference,
and the refined properties about the inputs and outputs otherwise.
Infers properties about the input and output tensors . The ` inputs ` and ` outputs ` arguments correspond to properties about the input and output tensors that are already known . Returns Err in case of an unrecoverable error during the inference and the refined properties about the inputs and outputs otherwise .
fn infer(
        &self,
        inputs: TVec<&TensorFact>,
        outputs: TVec<&TensorFact>,
    ) -> TractResult<(TVec<TensorFact>, TVec<TensorFact>)> {
        let (infered_inputs, infered_outputs) = self.infer_facts(inputs, outputs)?;
        if let Some(stateless) = self.as_stateless() {
            if infered_inputs.iter().all(|i| i.value.is_concrete()) {
                let input_values = infered_inputs
                    .iter()
                    .map(|i| i.value.concretize().unwrap().clone().into())
                    .collect(); // checked
                let output_values = stateless
                    .eval(input_values)?
                    .into_iter()
                    .map(|t| t.into())
                    .collect::<TVec<_>>();
                return Ok((infered_inputs, output_values));
            }
        }
        Ok((infered_inputs, infered_outputs))
    }
fn infer ( & self , inputs : TVec < & TensorFact > , outputs : TVec < & TensorFact > , ) -> TractResult < ( TVec < TensorFact > , TVec < TensorFact > ) > { let ( infered_inputs , infered_outputs ) = self . infer_facts ( inputs , outputs ) ? ; if let Some ( stateless ) = self . as_stateless ( ) { if infered_inputs . iter ( ) . all ( | i | i . value . is_concrete ( ) ) { let input_values = infered_inputs . iter ( ) . map ( | i | i . value . concretize ( ) . unwrap ( ) . clone ( ) . into ( ) ) . collect ( ) ; // checked let output_values = stateless . eval ( input_values ) ? . into_iter ( ) . map ( | t | t . into ( ) ) . collect :: < TVec < _ > > ( ) ; return Ok ( ( infered_inputs , output_values ) ) ; } } Ok ( ( infered_inputs , infered_outputs ) ) }
Infers properties about the input and output tensors.
Infers properties about the input and output tensors .
&self
inputs
TVec<&TensorFact>
outputs
TVec<&TensorFact>
&self
inputs
TVec<&TensorFact>
outputs
TVec<&TensorFact>