title: Tensorflow: How to use a Ragged Tensor as an index into a normal tensor?
body: <p>I have a 2D RaggedTensor consisting of indices I want from each row of a full tensor, e.g.:</p>
  <pre><code>[
      [0,4],
      [1,2,3],
      [5]
  ]
  </code></pre>
  <p>into</p>
  <pre><code>[
      [200, 305, 400, 20, 20, 105],
      [200, 315, 401, 20, 20, 167],
      [200, 7, 402, 20, 20, 105],
  ]
  </code></pre>
  <p>gives</p>
  <pre><code>[
      [200,20],
      [315,401,20],
      [105]
  ]
  </code></pre>
  <p>How can I achieve this in the most efficient way (preferably only with <code>tf</code> functions)? I believe that things like <code>gather_nd</code> are able to take RaggedTensors but I cannot figure out how it works.</p>