def perform(self, node, iargs, ostor):
        images, filters = iargs

        igroups, icolors_per_group, irows, icols, icount = images.shape
        fmodulesR, fmodulesC, fcolors, frows, fcols = filters.shape[:-2]
        fgroups, filters_per_group = filters.shape[-2:]

        hshape = self.infer_shape(node, (images.shape, filters.shape))[0]

        hidacts = numpy.zeros(hshape, dtype=images.dtype)

        for mR in xrange(fmodulesR):
            for mC in xrange(fmodulesC):
                for gg in xrange(igroups):
                    img_r_offset = mR * self.module_stride
                    img_c_offset = mC * self.module_stride
                    rc_images = images[gg, :,
                            img_r_offset:img_r_offset + frows,
                            img_c_offset:img_c_offset + fcols,
                            :]
                    rc_filters = filters[mR, mC, :, :, :, gg, :]
                    # rc_images are fcolors x frows x fcols x count
                    # rc_filters are fcolors x frows x fcols x fpg

                    left_arg = rc_filters.reshape(-1, filters_per_group).T
                    right_arg = rc_images.reshape(-1, icount)

                    try:
                        rc_hidacts = numpy.dot(left_arg, right_arg)
                    except ValueError as e:
                        if str(e) in 'matrices are not aligned':
                            raise ValueError("matrices are not aligned: " + \
                                    str(left_arg.shape) + ' vs ' + str(right_arg.shape))
                        else:
                            raise
                    hidacts[gg, :, mR, mC, :] = rc_hidacts
        ostor[0][0] = hidacts

        print_sizes = 0
        if print_sizes:
            print('FilterActs shapes: images', images.shape)
            print('FilterActs shapes: filters', filters.shape)
            print('FilterActs shapes: hidacts', hidacts.shape)
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/packaged_dependencies/theano_linear/unshared_conv/unshared_conv.py/FilterActs.perform/swapped operands of `in`