pub async fn infer<'a>(
        &self,
        inference_inputs: &HashMap<String, InputTensor<'a>>,
    ) -> Result<HashMap<String, OutputTensor>, GpuError> {
        log::info!("encode inference steps");
        let mut encoder = self
            .device
            .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
        for step in &self.steps {
            step.encode(&self.queue, &mut encoder, inference_inputs)?;
        }
        log::info!("submit inference steps");
        self.queue.submit(Some(encoder.finish()));
        log::info!("inference completed");
        self.read_outputs(inference_inputs).await
    }
/// Perform inference using this model and the specified inference inputs.
Perform inference using this model and the specified inference inputs.
Perform inference using this model and the specified inference inputs .
pub async fn infer<'a>(
        &self,
        inference_inputs: &HashMap<String, InputTensor<'a>>,
    ) -> Result<HashMap<String, OutputTensor>, GpuError> {
        log::info!("encode inference steps");
        let mut encoder = self
            .device
            .create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
        for step in &self.steps {
            step.encode(&self.queue, &mut encoder, inference_inputs)?;
        }
        log::info!("submit inference steps");
        self.queue.submit(Some(encoder.finish()));
        log::info!("inference completed");
        self.read_outputs(inference_inputs).await
    }
pub async fn infer < ' a > ( & self , inference_inputs : & HashMap < String , InputTensor < ' a > > , ) -> Result < HashMap < String , OutputTensor > , GpuError > { log :: info ! ( " " ) ; let mut encoder = self . device . create_command_encoder ( & wgpu :: CommandEncoderDescriptor { label : None } ) ; for step in & self . steps { step . encode ( & self . queue , & mut encoder , inference_inputs ) ? ; } log :: info ! ( " " ) ; self . queue . submit ( Some ( encoder . finish ( ) ) ) ; log :: info ! ( " " ) ; self . read_outputs ( inference_inputs ) . await }
Perform inference using this model and the specified inference inputs.
Perform inference using this model and the specified inference inputs .
&self
inference_inputs
&HashMap<String, InputTensor<'a>>
&self
inference_inputs
&HashMap<String, InputTensor<'a>>