parameters: (self, x)
docstring: Static check that the argument `x` is proper `shape`, `dtype`.
docstring_summary: Static check that the argument `x` is proper `shape`, `dtype`.
docstring_tokens: Static check that the argument x is proper shape dtype .
function: def _check_x(self, x):
      """Static check that the argument `x` is proper `shape`, `dtype`."""
      # x is a typical argument e.g. to matmul or solve.  In both cases, x should
      # have the same type/shape since this is a square matrix.  These checks are
      # usually not needed since we usually have some tensor backing this
      # distribution, and the calls to tf.matmul do a shape/type check.
      #
      # Static checks only for efficiency, the identity should be fast.
      #
      # Why check at all?  Because we want this operator to be swappable for a
      # real Operator.
      if self.dtype != x.dtype:
        raise TypeError(
            "Expected argument \"x\" to have same dtype as this operator (%s).  "
            "Found: %s" % (self.dtype, x.dtype))
  
      x_shape = x.get_shape()
      self_shape = self.get_shape()
      found_msg = (
          "Found: operator.shape = %s,  x.shape = %s" % (self_shape, x_shape))
      if x_shape.ndims is not None and self_shape.ndims is not None:
        if x_shape.ndims != self_shape.ndims:
          raise ValueError(
              "Expected argument \"x\" to have same tensor rank as this "
              "operator. " + found_msg)
        if x_shape.is_fully_defined() and self_shape.is_fully_defined():
          if x_shape[-2] != self_shape[-1]:
            raise ValueError(
                "Incompatible shapes for matrix-matrix operation.  " + found_msg)
function_tokens: def _check_x ( self , x ) : # x is a typical argument e.g. to matmul or solve.  In both cases, x should # have the same type/shape since this is a square matrix.  These checks are # usually not needed since we usually have some tensor backing this # distribution, and the calls to tf.matmul do a shape/type check. # # Static checks only for efficiency, the identity should be fast. # # Why check at all?  Because we want this operator to be swappable for a # real Operator. if self . dtype != x . dtype : raise TypeError ( "Expected argument \"x\" to have same dtype as this operator (%s).  " "Found: %s" % ( self . dtype , x . dtype ) ) x_shape = x . get_shape ( ) self_shape = self . get_shape ( ) found_msg = ( "Found: operator.shape = %s,  x.shape = %s" % ( self_shape , x_shape ) ) if x_shape . ndims is not None and self_shape . ndims is not None : if x_shape . ndims != self_shape . ndims : raise ValueError ( "Expected argument \"x\" to have same tensor rank as this " "operator. " + found_msg ) if x_shape . is_fully_defined ( ) and self_shape . is_fully_defined ( ) : if x_shape [ - 2 ] != self_shape [ - 1 ] : raise ValueError ( "Incompatible shapes for matrix-matrix operation.  " + found_msg )