def bconv_slice(x, S, Q, padding, strides):
    qs = x - (S - padding - 1)
    firstF = None
    for s in range(S): #TODO remove loop logic here.
        q = qs + s
        if q % strides == 0:
            q //= strides
            if q >= 0 and q < Q:
                if firstF is None:
                    firstF = s
                    firstE = q
                lastF = s
                lastE = q
    return (slice(firstF,lastF+1,strides), slice(firstE,lastE+1,strides), 0)
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/winograd4.py/bconv_slice/original