I am not sure how to word this question properly so I will show some examples to describe the desired behaviour.
I'm looking to divide a tensor in this specific way.
Divide a vector by 1 scalar, for example
[1, 2, 3, 4, 5]divided by 2 =[0.5, 1, 1.5, 2, 2.5]Divide a matrix by 2 scalars, for example
[[1, 2, 3], [2, 3, 4]]by[2, 4]=[[0.5, 1, 1.5], [0.5, 0.75, 1]]Divide a 3 dimensional tensor by a 2 dimensional tensor, for example
[[[1, 2, 3], [2, 3, 4]], [[4,5,6], [7,8,9]], [[9,8,6], [1,2,3]]]divided by[[1, 2], [3, 4], [5, 6]]=[[[1, 2, 3], [1, 1.5, 2]], [[4/3,5/3,2], [7/4,2,9/4]], [[9/5,8/5,6/5], [1/6,2/6,3/6]]]Divide a N dimensional tensor by a N-1 dimensional tensor...
I'm looking for a pytorch way to do this.