parameters: (self, chol)
return_statement: return control_flow_ops.with_dependencies(deps, chol)
docstring: Verify that `chol` is proper.
docstring_summary: Verify that `chol` is proper.
docstring_tokens: Verify that chol is proper .
function: def _check_chol(self, chol):
      """Verify that `chol` is proper."""
      chol = ops.convert_to_tensor(chol, name='chol')
      if not self.verify_pd:
        return chol
  
      shape = array_ops.shape(chol)
      rank = array_ops.rank(chol)
  
      is_matrix = check_ops.assert_rank_at_least(chol, 2)
      is_square = check_ops.assert_equal(
          array_ops.gather(shape, rank - 2), array_ops.gather(shape, rank - 1))
  
      deps = [is_matrix, is_square]
      diag = array_ops.batch_matrix_diag_part(chol)
      deps.append(check_ops.assert_positive(diag))
  
      return control_flow_ops.with_dependencies(deps, chol)
function_tokens: def _check_chol ( self , chol ) : chol = ops . convert_to_tensor ( chol , name = 'chol' ) if not self . verify_pd : return chol shape = array_ops . shape ( chol ) rank = array_ops . rank ( chol ) is_matrix = check_ops . assert_rank_at_least ( chol , 2 ) is_square = check_ops . assert_equal ( array_ops . gather ( shape , rank - 2 ) , array_ops . gather ( shape , rank - 1 ) ) deps = [ is_matrix , is_square ] diag = array_ops . batch_matrix_diag_part ( chol ) deps . append ( check_ops . assert_positive ( diag ) ) return control_flow_ops . with_dependencies ( deps , chol )