title: How to write torch.device('cuda' if torch.cuda.is_available() else 'cpu') as a full if else statement?
body: <p>I'm a beginner to Pytorch and wanted to type this statement as a whole if else statement:-</p>
  <pre class="lang-py prettyprint-override"><code>torch.device('cuda' if torch.cuda.is_available() else 'cpu')
  </code></pre>
  <p>Can somebody help me?</p>