Best way to track pos-neg or neg-pos zero crossings in 3D tensor?

Hi all. If I have a 3D tensor (say 32x32x32) and I’m indexing along a dimension such that I’m dealing with a 2D 32x32 tensor at each index, I was wondering what the best way would be to track zero crossings of values? Would an approach like listed here for Numpy work with tensors as well? Thanks!

Convolve the 3dsignal twice with the proper kernel to compute the derivatives and you can go from there