Hi,
When you say the batch dimension, is it the first dimension in your example? Or another dimension to add to your example?
Also the formula that you want is the following?
forall i in A.size(0), forall j in x.size(0) - 1: A[i, x[i, j], x[i, j+1]] = 1
Meaning that every pair of consecutive values in x are the the indices where you should put a 1 ?