original_docstring: Move the DenseFsaVec onto a given device.
  
          Args:
            device:
              An instance of `torch.device` or a string that can be used to
              construct a `torch.device`, e.g., 'cpu', 'cuda:0'.
              It supports only cpu and cuda devices.
  
          Returns:
            Returns a new DenseFsaVec which is this object copied to the given
            device (or this object itself, if the device was the same).
          
docstring: Move the DenseFsaVec onto a given device.
docstring_tokens: Move the DenseFsaVec onto a given device .
code: def to(self, device: Union[torch.device, str]) -> 'DenseFsaVec':
          '''Move the DenseFsaVec onto a given device.
  
          Args:
            device:
              An instance of `torch.device` or a string that can be used to
              construct a `torch.device`, e.g., 'cpu', 'cuda:0'.
              It supports only cpu and cuda devices.
  
          Returns:
            Returns a new DenseFsaVec which is this object copied to the given
            device (or this object itself, if the device was the same).
          '''
          if isinstance(device, str):
              device = torch.device(device)
  
          assert device.type in ('cpu', 'cuda')
          if device == self.scores.device:
              return self
  
          scores = self.scores.to(device)
          dense_fsa_vec = self.dense_fsa_vec.to(device)
          return DenseFsaVec._from_dense_fsa_vec(dense_fsa_vec, scores)
code_tokens: def to ( self , device : Union [ torch . device , str ] ) -> 'DenseFsaVec' : if isinstance ( device , str ) : device = torch . device ( device ) assert device . type in ( 'cpu' , 'cuda' ) if device == self . scores . device : return self scores = self . scores . to ( device ) dense_fsa_vec = self . dense_fsa_vec . to ( device ) return DenseFsaVec . _from_dense_fsa_vec ( dense_fsa_vec , scores )
short_docstring: Move the DenseFsaVec onto a given device.
short_docstring_tokens: Move the DenseFsaVec onto a given device .
comment: '''Move the DenseFsaVec onto a given device.
  
          Args:
            device:
              An instance of `torch.device` or a string that can be used to
              construct a `torch.device`, e.g., 'cpu', 'cuda:0'.
              It supports only cpu and cuda devices.
  
          Returns:
            Returns a new DenseFsaVec which is this object copied to the given
            device (or this object itself, if the device was the same).
          '''