def __repr__(self):
    """Renders this layer as a medium-detailed string, to help in debugging.

    Subclasses should aim for high-signal/low-noise when overriding this
    method.

    Returns:
      A high signal-to-noise string representing this layer.
    """
    def indent_string(x):
      return '  ' + x.replace('\n', '\n  ')

    name_str = self._name
    n_in, n_out = self.n_in, self.n_out
    if n_in != 1: name_str += f'_in{n_in}'
    if n_out != 1: name_str += f'_out{n_out}'

    if self._sublayers_to_print is not None:
      substructure = self._sublayers_to_print
    else:
      substructure = self.sublayers
    if substructure:
      substructure_strs = [str(x) for x in substructure if str(x)]
      substructure_str = '\n'.join(indent_string(s) for s in substructure_strs)
      return f'{name_str}[\n{substructure_str}\n]'
    else:
      return name_str
Renders this layer as a medium-detailed string, to help in debugging.

    Subclasses should aim for high-signal/low-noise when overriding this
    method.

    Returns:
      A high signal-to-noise string representing this layer.
    
trax/layers/base.py