Hi,
Does anyone know how to differentiably ‘select’ indices that fall on a 2D line within a 2D tensor / rectangle ?
Something like this:
buffer = Variable( torch.FloatTensor( 128, 128 ) )
p0 = Variable( torch.FloatTensor( [2.4, 9.4] ) ) 
p1 = Variable( torch.FloatTensor( [5, 11.5] ) ) 

# magic happens here
buffer.lineSelect(p0, p1).fill( 1 ) 

Ideally lineSelect would automatically round float values to their proper discrete indices and would be differentiable.
My plan is to use this method to implement a differentiable 3D renderer in pytorch.
The nearest insight I found on the forum is this but it does not really show out to ‘select’ from a buffer. Indexing a variable with a variable