Solved by Napam in post #2 
              
              
                Hi, your problem seems to be easily “broadcastable”!  Using broadcasting and such is much faster than looping in Python. From my understanding you want to do L1-loss (with some scaling), where you exclude the loss caused from negative depth values in the ground truth. 
Here is my attempt at implemen…