

def tensors_for_ndarrays(datas, basename):
    if isinstance(datas, _np.ndarray):
        return make_tensor(datas.dtype, datas.ndim, basename)
    if isinstance(datas, (list, tuple)):
        return [tensors_for_ndarrays(data, '{}_{}'.format(basename, i)) for (i, data) in enumerate(datas)]
    raise TypeError('I only understand lists or tuples of numpy arrays! (possibly nested)')

dataset/ETHPy150Open lucasb-eyer/DeepFried2/DeepFried2/utils.py tensors_for_ndarrays/original