@staticmethod
    def viewOnFlatLayer(layer, dimensions, name = None):
        assert max(dimensions) > 1, "At least one dimension needs to be larger than one."
        def slicer():
            nbunits = reduce(lambda x, y: x*y, dimensions, 1)
            insize = layer.indim // nbunits
            outsize = layer.outdim // nbunits
            for index in range(nbunits):
                yield ModuleSlice(layer, insize*index, insize*(index+1), outsize*index, outsize*(index+1))
        c = slicer()
        return ModuleMesh(lambda: next(c), dimensions, name)
Match the eagerly loaded results to their parents.
dataset/ETHPy150Open pybrain/pybrain/pybrain/structure/modulemesh.py/ModuleMesh.viewOnFlatLayer--crossover with--dataset/ETHPy150Open sdispater/orator/orator/orm/relations/has_many.py/HasMany.match