code: def sdot( U, V ):
      '''
      Computes the tensorproduct reducing last dimensoin of U with first dimension of V.
      For matrices, it is equal to regular matrix product.
      '''
      nu = U.ndim
      #nv = V.ndim
      return np.tensordot( U, V, axes=(nu-1,0) f sdot( U, V ):
      '''
      Computes the tensorproduct reducing last dimensoin of U with first dimension of V.
      For matrices, it is equal to regular matrix product.
      '''
      nu = U.ndim
      #nv = V.ndim
      return np.tensordot( U, V, axes=(nu-1,0) )
docs: Computes the tensorproduct reducing last dimensoin of U with first dimension of V.
      For matrices, it is equal to regular matrix product.