File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -582,16 +582,17 @@ class VulkanBackend final : public ::executorch::runtime::BackendInterface {
582582    compute_graph->execute ();
583583
584584    for  (size_t  i = 0 ; i < compute_graph->outputs ().size (); i++) {
585+       const  size_t  o = i + num_inputs;
585586      const  ValueRef oref = compute_graph->outputs ()[i].value ;
586587      if  (compute_graph->val_is_tensor (oref)) {
587-         VK_CHECK_COND (args[i ]->isTensor ());
588-         maybe_resize_output (compute_graph, i, args[num_inputs + i ]->toTensor ());
588+         VK_CHECK_COND (args[o ]->isTensor ());
589+         maybe_resize_output (compute_graph, i, args[o ]->toTensor ());
589590        //  args holds inputs directly followed by outputs, so the i'th output
590-         //  for compute_graph corresponds to the (i + num_inputs) 'th arg
591+         //  for compute_graph corresponds to the o 'th arg
591592        compute_graph->copy_from_staging (
592593            compute_graph->outputs ()[i].staging ,
593-             args[num_inputs + i ]->toTensor ().mutable_data_ptr (),
594-             args[num_inputs + i ]->toTensor ().numel ());
594+             args[o ]->toTensor ().mutable_data_ptr (),
595+             args[o ]->toTensor ().numel ());
595596      } else  {
596597        VK_THROW (
597598            " Could not handle output with type " 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments