def to_numpy(tensors):
    """Converts tf.Tensors to numpy array.

    Parameters
    ----------
    tensors : tf.Tensor | dict | list

    Returns
    -------
    arrays : np.array | dict | list

    """
    if type(tensors) == list:
        return [to_numpy(t) for t in tensors]
    if type(tensors) == dict:
        return {k: to_numpy(v) for k, v in tensors.items()}
    return tensors.numpy()