Solved by KFrank in post #2 
              
              
                Hi Thomas! 

I do not know of any functionality built into pytorch similar to your 
apply_along_axis().  And even if there were, it would still impose 
a performance penalty, as it would still be breaking up what might 
have been a single, larger tensor operation into many smaller, axis-wise 
tensor…