title: Treat a tuple/list of Tensors as a single Tensor
body: <p>I'm using Pytorch for some robotics Reinforcement Learning tasks. I'd like to use both images and information about the state as observations for this task. The implementation I'm using does not directly support this so I'm making some amendments. Expected observations are either state, as a 1 dimensional Tensor, or images as a 3 dimensional Tensor (channels, width, height). In my task I would like the observation to be a tuple of Tensors.</p>
  
  <p>In many places in my codebase, the observation is of course expected to be a single Tensor, not a tuple of Tensors. <strong>Is there an easy way to treat a tuple of Tensors as a single Tensor?</strong></p>
  
  <p>For example, I would like:</p>
  
  <pre><code>observation.to(device)
  </code></pre>
  
  <p>to work as normal when <code>observation</code> is a single Tensor, and call <code>.to(device)</code> on each Tensor when <code>observation</code> is a tuple of Tensors.</p>
  
  <p>It should be simple enough to create a data type that can support this, but I'm wondering does such a data type already exist? I haven't found anything so far. </p>