class_docstr: Load biological sequence data, either from a fasta file or a python list.
  
  :param source: Either the input fasta file path (str) or the input list
      of sequences (list of str).
  :param str source_type: Type of input, either 'list' or 'fasta'.
  :param str alphabet: Alphabet to use. Alphabets 'amino-acid' and 'dna' are
      preset; any other input will be interpreted as the alphabet itself,
      i.e. you can use 'ACGU' for RNA.
  :param int max_length: Total length of the one-hot representation of the
      sequences, including zero padding. Defaults to the maximum sequence
      length in the dataset.
  :param bool include_stop: Append stop symbol to the end of each sequence
      and add the stop symbol to the alphabet.
  :param torch.device device: Device on which data should be stored in
      memory.
class_docstr_tok: ["Load","biological","sequence","data",",","either","from","a","fasta","file","or","a","python","list",".",":","param","source",":","Either","the","input","fasta","file","path","(","str",")","or","the","input","list","of","sequences","(","list","of","str",")",".",":","param","str","source_type",":","Type","of","input",",","either","'list","'","or","'fasta","'",".",":","param","str","alphabet",":","Alphabet","to","use",".","Alphabets","'amino-acid","'","and","'dna","'","are","preset",";","any","other","input","will","be","interpreted","as","the","alphabet","itself",",","i.e",".","you","can","use","'ACGU","'","for","RNA",".",":","param","int","max_length",":","Total","length","of","the","one-hot","representation","of","the","sequences",",","including","zero","padding",".","Defaults","to","the","maximum","sequence","length","in","the","dataset",".",":","param","bool","include_stop",":","Append","stop","symbol","to","the","end","of","each","sequence","and","add","the","stop","symbol","to","the","alphabet",".",":","param","torch.device","device",":","Device","on","which","data","should","be","stored","in","memory","."]
docstr: One hot encode and pad with zeros to max length.
docstr_tok: ["One","hot","encode","and","pad","with","zeros","to","max","length","."]
code: def _one_hot(self, seq, alphabet, length):
      """One hot encode and pad with zeros to max length."""
      # One hot encode.
      oh = torch.tensor(
          (np.array(list(seq))[:, None] == alphabet[None, :]).astype(
              np.float64
          ),
          device=self.device,
      )
      # Pad.
      x = torch.cat(
          [
              oh,
              torch.zeros(
                  [length - len(seq), len(alphabet)], device=self.device
              ),
          ]
      )
  
      return x
  
file_path: pyro/pyro/contrib/mue/dataloaders.py
imports: import numpy
  import torch
  from torch.utils.data import Dataset
label_desc: Use image node_id 3 for calling the BiosequenceDataset obj's underlying member method code with example usage: obj._one_hot(seq, alphabet, length) and returns: x