def buffered_future_mask(self, tensor):
    dim = tensor.size(0)
    if ((not hasattr(self, '_future_mask')) or (self._future_mask is None) or (self._future_mask.device != tensor.device) or (self._future_mask.size(0) < dim)):
        self._future_mask = torch.triu(utils.fill_with_neg_inf(tensor.new(dim, dim)), 1)
    return self._future_mask[:dim, :dim]
def buffered_future_mask(self, tensor):
    dim = tensor.size(0)
    if ((not hasattr(self, '_future_mask')) or (self._future_mask is None) or (self._future_mask.device != tensor.device) or (self._future_mask.size(0) < dim)):
        self._future_mask = torch.triu(utils.fill_with_neg_inf(tensor.new(dim, dim)), 1)
    return self._future_mask[:dim, :dim]