async fn read_outputs<'a>(
        &self,
        inference_inputs: &HashMap<String, InputTensor<'a>>,
    ) -> Result<HashMap<String, OutputTensor>, GpuError> {
        let mut output_data: HashMap<String, OutputTensor> = HashMap::new();

        for (output_name, output_source) in &self.inference_outputs {
            output_data.insert(
                output_name.to_string(),
                match output_source {
                    InferenceOutput::InferenceInput(input_name) => {
                        (&inference_inputs[input_name]).into()
                    }
                    InferenceOutput::Tensor(tensor) => {
                        tensor.read_to_vec(&self.device, &self.queue).await?
                    }
                },
            );
        }

        Ok(output_data)
    }
/// Reads the relevant buffers for the requested inference outputs
Reads the relevant buffers for the requested inference outputs
Reads the relevant buffers for the requested inference outputs
async fn read_outputs<'a>(
        &self,
        inference_inputs: &HashMap<String, InputTensor<'a>>,
    ) -> Result<HashMap<String, OutputTensor>, GpuError> {
        let mut output_data: HashMap<String, OutputTensor> = HashMap::new();
        for (output_name, output_source) in &self.inference_outputs {
            output_data.insert(
                output_name.to_string(),
                match output_source {
                    InferenceOutput::InferenceInput(input_name) => {
                        (&inference_inputs[input_name]).into()
                    }
                    InferenceOutput::Tensor(tensor) => {
                        tensor.read_to_vec(&self.device, &self.queue).await?
                    }
                },
            );
        }
        Ok(output_data)
    }
async fn read_outputs < ' a > ( & self , inference_inputs : & HashMap < String , InputTensor < ' a > > , ) -> Result < HashMap < String , OutputTensor > , GpuError > { let mut output_data : HashMap < String , OutputTensor > = HashMap :: new ( ) ; for ( output_name , output_source ) in & self . inference_outputs { output_data . insert ( output_name . to_string ( ) , match output_source { InferenceOutput :: InferenceInput ( input_name ) => { ( & inference_inputs [ input_name ] ) . into ( ) } InferenceOutput :: Tensor ( tensor ) => { tensor . read_to_vec ( & self . device , & self . queue ) . await ? } } , ) ; } Ok ( output_data ) }
Reads the relevant buffers for the requested inference outputs
Reads the relevant buffers for the requested inference outputs
&self
inference_inputs
&HashMap<String, InputTensor<'a>>
&self
inference_inputs
&HashMap<String, InputTensor<'a>>