parameters: (input_, shape)
return_statement: return tuple(result)
docstring: Converts ellipsis to slice.
docstring_summary: Converts ellipsis to slice.
docstring_tokens: Converts ellipsis to slice .
function: def ellipsis2slice(input_, shape):
      """Converts ellipsis to slice."""
      input_slice = input_
      result = []
      if isinstance(input_, type(...)):
          input_slice = (input_,)
      ell_count = 0
      for _, element in enumerate(input_slice):
          if not isinstance(element, type(...)):
              result.append(element)
              continue
          ell_count += 1
          if ell_count > 1:
              raise IndexError("There cannot be more than one ellisis (...) in the index of the tensor, "
                               "but it is currently {}".format(input_slice))
          for _ in range(len(shape) - len(input_slice) + 1):
              result.append(slice(None, None, None))
      return tuple(result)
function_tokens: def ellipsis2slice ( input_ , shape ) : input_slice = input_ result = [ ] if isinstance ( input_ , type ( ... ) ) : input_slice = ( input_ , ) ell_count = 0 for _ , element in enumerate ( input_slice ) : if not isinstance ( element , type ( ... ) ) : result . append ( element ) continue ell_count += 1 if ell_count > 1 : raise IndexError ( "There cannot be more than one ellisis (...) in the index of the tensor, " "but it is currently {}" . format ( input_slice ) ) for _ in range ( len ( shape ) - len ( input_slice ) + 1 ) : result . append ( slice ( None , None , None ) ) return tuple ( result )