import torch

class Compose():
    """Composes several transforms together.
    Args:
        transforms (list of ``Transform`` objects): list of transforms to compose.
    """

    def __init__(self, transforms):
        self.transforms = transforms

    def __call__(self, seq):
        for t in self.transforms:
            seq = t(seq)
        return seq

    def __repr__(self):
        format_string = self.__class__.__name__ + '('
        for t in self.transforms:
            format_string += '\n'
            format_string += '    {0}'.format(t)
        format_string += '\n)'
        return format_string

class ToTensor():
    def __call__(self, seq):
        return torch.tensor(seq, dtype=torch.long)

    def __repr__(self):
        return self.__class__.__name__ + '()'
import torch

class Compose():
    """Composes several transforms together.
    Args:
        transforms (list of ``Transform`` objects): list of transforms to compose.
    """

    def __init__(self, transforms):
        self.transforms = transforms

    def __call__(self, seq):
        for t in self.transforms:
            seq = t(seq)
        return seq

    def __repr__(self):
        format_string = self.__class__.__name__ + '('
        for t in self.transforms:
            format_string += '\n'
            format_string += '    {0}'.format(t)
        format_string += '\n)'
        return format_string

class ToTensor():
    def __call__(self, seq):
        return torch.tensor(seq, dtype=torch.long)

    def __repr__(self):
        return self.__class__.__name__ + '()'
Composes several transforms together.     Args:         transforms (list of ``Transform`` objects): list of transforms to compose.