What you have try seems right and I am not sure why it wont work in your case, for example, the following runs without problem:
X = np.random.randint(1000,size=(10000, 2))
Xval = np.random.randn(10000)
Xbatch = pm.Minibatch(X)
Xval_b = pm.Minibatch(Xval)
nrows = ncols = 1000
latent_dim = 5
with pm.Model():
A=pm.Normal('A',mu=0,sd=.5, shape=(nrows, latent_dim))
B=pm.Normal('B',mu=0,sd=.5, shape=(latent_dim, ncols))
Xhat= pm.math.dot(A[Xbatch[:,0]], B[:,Xbatch[:,1]])
Xvar = pm.Normal('Xvar',mu=Xhat, sd=1.0, observed=Xval_b)
approx = pm.fit(method='advi')
Maybe the problem is using pandas dataframe/series in Xrow_ind = pm.Minibatch(X.row_ind). Try converting them into numpy array.