title: How can I change part of a PyTorch tensor based on the values of another tensor?
body: <p>This question may not be clear, so please ask for clarification in the comments and I will expand.</p>
  
  <p>I have the following tensors of the following shape:</p>
  
  <pre><code>mask.size() == torch.Size([1, 400])
  clean_input_spectrogram.size() == torch.Size([1, 400, 161])
  output.size() == torch.Size([1, 400, 161])
  </code></pre>
  
  <p><code>mask</code> is comprised only of <code>0</code> and <code>1</code>. Since it's a mask, I want to set the elements of <code>output</code> equal to <code>clean_input_spectrogram</code> where that relevant <code>mask</code> value is <code>1</code>.</p>
  
  <p>How would I do that?</p>