original_docstring: Assert that a matrix is orthogonal.
docstring: Assert that a matrix is orthogonal.
docstring_tokens: Assert that a matrix is orthogonal .
code: def assert_orthogonal(x):
      """Assert that a matrix is orthogonal."""
      # Check that matrix is square.
      assert B.shape(x)[0] == B.shape(x)[1]
  
      # Check that its transpose is its inverse.
      approx(B.matmul(x, x, tr_a=True), B.eye(x))
code_tokens: def assert_orthogonal ( x ) : assert B . shape ( x ) [ 0 ] == B . shape ( x ) [ 1 ] approx ( B . matmul ( x , x , tr_a = True ) , B . eye ( x ) )
short_docstring: Assert that a matrix is orthogonal.
short_docstring_tokens: Assert that a matrix is orthogonal .
comment: """Assert that a matrix is orthogonal."""$SEP$# Check that matrix is square.$SEP$# Check that its transpose is its inverse.