class_docstr: Initialize matrix with orthogonal basis.
  
  Parameters
  ----------
  scale : int, float
      Scales output matrix by a specified factor.
      Defaults to ``1``.
  
  seed : None or int
      Random seed. Integer value will make results reproducible.
      Defaults to ``None``.
  
  Raises
  ------
  ValueError
      In case if tensor shape has more than 2
      dimensions.
  
  Methods
  -------
  {Initializer.Methods}
class_docstr_tok: ["Initialize","matrix","with","orthogonal","basis",".","Parameters","--","--","--","--","--","scale",":","int",",","float","Scales","output","matrix","by","a","specified","factor",".","Defaults","to","``","1","``",".","seed",":","None","or","int","Random","seed",".","Integer","value","will","make","results","reproducible",".","Defaults","to","``","None","``",".","Raises","--","--","--","ValueError","In","case","if","tensor","shape","has","more","than","2","dimensions",".","Methods","--","--","--","-","{","Initializer.Methods","}"]
code: def sample(self, shape, return_array=False):
      ndim = len(shape)
  
      if ndim not in (1, 2):
          raise ValueError(
              "Shape attribute must have 1 or 2 dimensions. "
              "Found {} dimensions".format(ndim)
          )
  
      normal = Normal(seed=self.seed)
      rand_matrix = normal.sample(shape, return_array)
  
      if ndim == 1:
          return rand_matrix
  
      if return_array:
          u, _, v = np.linalg.svd(rand_matrix, full_matrices=False)
      else:
          _, u, v = tf.linalg.svd(rand_matrix, full_matrices=False)
          v = tf.transpose(v)
  
      nrows, ncols = shape
      ortho_base = u if nrows > ncols else v
      return self.scale * ortho_base[:nrows, :ncols]
  
imports: import abc
  import six
  import numpy
  import tensorflow
  from neupy.core.docs import SharedDocsABCMeta
label_desc: Use image node_id 2 for calling the Orthogonal obj's underlying member method code with example usage: obj.sample(shape, return_array) and returns: unknown, rand_matrix