def batch_dot(x, y, axes=None):
 if isinstance(axes, int):
  axes = (axes, axes)
 if (axes is None):
  axes = [(x.ndim - 1), (y.ndim - 2)]
 out = T.batched_tensordot(x, y, axes=axes)
 if (ndim(out) == 1):
  out = expand_dims(out, 1)
 return out

def batch_dot ( x , y , axes = None ) : if isinstance ( axes , int ) : axes = ( axes , axes ) if ( axes is None ) : axes = [ ( x . ndim - 1 ) , ( y . ndim - 2 ) ] out = T . batched_tensordot ( x , y , axes = axes ) if ( ndim ( out ) == 1 ) : out = expand_dims ( out , 1 ) return out
batchwise dot product .