def METHOD_NAME(self, length):
    """
    Return the nearest valid length to use with the model so that
    there is no time steps left over in a convolutions, e.g. for all
    layers, size of the input - kernel_size % stride = 0.
    If the mixture has a valid length, the estimated sources
    will have exactly the same length when context = 1. If context > 1,
    the two signals can be center trimmed to match.
    For training, extracts should have a valid length.For evaluation
    on full tracks we recommend passing `pad = True` to :method:`forward`.
    """
    for _ in range(self.depth):
        if self.upsample:
            length = math.ceil(length / self.stride) + self.kernel_size - 1
        else:
            length = math.ceil((length - self.kernel_size) / self.stride) + 1
        length = max(1, length)
        length += self.context - 1
    for _ in range(self.depth):
        if self.upsample:
            length = length * self.stride + self.kernel_size - 1
        else:
            length = (length - 1) * self.stride + self.kernel_size
    return int(length)