'x.__getitem__(i) <=> x[i]
Returns a sliced view of the input symbol.
Example usage:
>>> a = mx.sym.var(\'a\')
>>> a.__getitem__(0)
<Symbol a>
>>> a[0]
<Symbol a>
Parameters
index : int or str
Indexing key'

def __getitem__(self, index):

    output_names = self.list_outputs()
    if isinstance(index, py_slice):
        start = (0 if (index.start is None) else index.start)
        stop = (len(output_names) if (index.stop is None) else index.stop)
        step = (1 if (index.step is None) else index.step)
        return Group([self[i] for i in range(start, stop, step)])
    if isinstance(index, string_types):
        idx = None
        for (i, name) in enumerate(output_names):
            if (name == index):
                if (idx is not None):
                    raise ValueError(('There    are    multiple    outputs    with    name    "%s"' % index))
                idx = i
        if (idx is None):
            raise ValueError(('Cannot    find    output    that    matches    name    "%s"' % index))
        index = idx
    if (not isinstance(index, int)):
        raise TypeError('Symbol    only    support    integer    index    to    fetch    i-th    output')
    if (index >= len(output_names)):
        raise IndexError
    handle = SymbolHandle()
    check_call(_LIB.MXSymbolGetOutput(self.handle, mx_uint(index), ctypes.byref(handle)))
    return Symbol(handle=handle)
