# Path: brainforge/llatomic/_llutil.py
# def Xd(X, t=nbfloatX):


import numpy as np
import numba as nb
from ._llutil import nbfloatX, Xd


intX = nb.typeof(int())


@nb.jit("{f3}({f4},{f4})".format(f3=Xd(3), f4=Xd(4)),
        nopython=True)
def _reshape_receptive_fields(A, F):
    im, ic, iy, ix = A.shape
    # fx, fy, fc, nf = F.shape
    nf, fc, fy, fx = F.shape
    oy, ox = iy - fy + 1, ix - fx + 1
    recfield_size = fx*fy*fc

# Path: brainforge/llatomic/_llutil.py
# def Xd(X, t=nbfloatX):


# Path: brainforge/llatomic/lltensor_op.py
import numpy as np
import numba as nb
from ._llutil import nbfloatX, Xd



intX = nb.typeof(int())


@nb.jit("{f3}({f4},{f4})".format(f3=Xd(3), f4=Xd(4)),
        nopython=True)
def _reshape_receptive_fields(A, F):
    im, ic, iy, ix = A.shape
    # fx, fy, fc, nf = F.shape
    nf, fc, fy, fx = F.shape
    oy, ox = iy - fy + 1, ix - fx + 1
    recfield_size = fx*fy*fc

    rfields = np.zeros((im, oy * ox, recfield_size), dtype=nbfloatX)