You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
I have a tensor (batches, a, b, 2, rows, cols) which is basically a bunch of pairs of (rows,cols) images - so let's simplify and say that I have a pair of images in a tensor A of shape (2, rows, cols).
It just so happens that this pair of images represents a coordinate (y,x), and I want to sample from a second tensor B at that coordinate. coord = (y,x) = ( A[0,v,u], A[1,v,u] )
Is there a Symbol operator that will let me create C = sample( B , A ) such that each pixel C[:,v,u] comes from the relevant pixel B[:,y,x] given the coordinate in A
I was thinking that gather_nd would maybe be the right choice, but I'm getting hopelessly confused trying to feed my coordinates to it.
Keep in mind please that I'm really wanting to do this for a batch of pairs of images - and I'm in C++ (hence using Symbol)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have a tensor (batches, a, b, 2, rows, cols) which is basically a bunch of pairs of (rows,cols) images - so let's simplify and say that I have a pair of images in a tensor A of shape (2, rows, cols).
It just so happens that this pair of images represents a coordinate (y,x), and I want to sample from a second tensor B at that coordinate.
coord = (y,x) = ( A[0,v,u], A[1,v,u] )
Is there a Symbol operator that will let me create
C = sample( B , A )
such that each pixelC[:,v,u]
comes from the relevant pixelB[:,y,x]
given the coordinate inA
I was thinking that
gather_nd
would maybe be the right choice, but I'm getting hopelessly confused trying to feed my coordinates to it.Keep in mind please that I'm really wanting to do this for a batch of pairs of images - and I'm in C++ (hence using Symbol)
Beta Was this translation helpful? Give feedback.
All reactions