original_docstring: 
      Generates predictions and corresponding probabilities from a trained
      network and a list of images
      
docstring: Generates predictions and corresponding probabilities from a trained
  network and a list of images
docstring_tokens: Generates predictions and corresponding probabilities from a trained network and a list of images
code: def images_to_probs(net, images):
      '''
      Generates predictions and corresponding probabilities from a trained
      network and a list of images
      '''
      output = net(images)
      # convert output probabilities to predicted class
      _, preds_tensor = torch.max(output, 1)
      preds = np.squeeze(preds_tensor.cpu().numpy())
      return preds, [
          F.softmax(el, dim=0)[i].item() for i, el in zip(preds, output)]
code_tokens: def images_to_probs ( net , images ) : output = net ( images ) _ , preds_tensor = torch . max ( output , 1 ) preds = np . squeeze ( preds_tensor . cpu ( ) . numpy ( ) ) return preds , [ F . softmax ( el , dim = 0 ) [ i ] . item ( ) for i , el in zip ( preds , output ) ]
short_docstring: Generates predictions and corresponding probabilities from a trained
  network and a list of images
short_docstring_tokens: Generates predictions and corresponding probabilities from a trained network and a list of images
comment: '''
      Generates predictions and corresponding probabilities from a trained
      network and a list of images
      '''$SEP$# convert output probabilities to predicted class