Hi,
I can take a stab at this.
Could you make a self contained script with your implementation, random inputs of the exact shape you’re interested in (including batch potentially and specifying which dimension is which with your math above) and the expected output?