parameters: (arr)
return_statement: return n_in, n_out
docstring: Calculate n_in and n_out.
  
      Args:
          arr (Array): Input array.
  
      Returns:
          Tuple, a tuple with two elements, the first element is `n_in` and the second element is `n_out`.
docstring_summary: Calculate n_in and n_out.
docstring_tokens: Calculate n_in and n_out .
function: def _calculate_in_and_out(arr):
      """
      Calculate n_in and n_out.
  
      Args:
          arr (Array): Input array.
  
      Returns:
          Tuple, a tuple with two elements, the first element is `n_in` and the second element is `n_out`.
      """
      dim = len(arr.shape)
      if dim < 2:
          raise ValueError("If initialize data with xavier uniform, the dimension of data must be greater than 1, "
                           "but got {}.".format(dim))
  
      n_in = arr.shape[1]
      n_out = arr.shape[0]
  
      if dim > 2:
          counter = reduce(lambda x, y: x * y, arr.shape[2:])
          n_in *= counter
          n_out *= counter
      return n_in, n_out
function_tokens: def _calculate_in_and_out ( arr ) : dim = len ( arr . shape ) if dim < 2 : raise ValueError ( "If initialize data with xavier uniform, the dimension of data must be greater than 1, " "but got {}." . format ( dim ) ) n_in = arr . shape [ 1 ] n_out = arr . shape [ 0 ] if dim > 2 : counter = reduce ( lambda x , y : x * y , arr . shape [ 2 : ] ) n_in *= counter n_out *= counter return n_in , n_out