Tensor indexing using another tensor value in cpp compute

Hi,
Can we access a tensor value whose index is value from another tensor. Something like this -

out = compute(out_shape, [&](Var i) {
return bias(mask(i));
};
);

where bias and mask both are Tensors.

What is the difference between this and what you did for take?