def onehot(self, indices, axis, out=None):
        """
        Generate optree for converting `indices` to a onehot representation

        Arguments:
            indices (Tensor): Elements must be of numpy integer type for gpu
                              onehot to work.
            axis (int): the axis along the feature length dimension
            out (Tensor, optional): where the result will be stored. If out is
                                    None, only the op-tree will be returned.

        Returns:
            OpTreeNode: the resulting op-tree
        """
        if axis not in (0, 1):
            raise ValueError("bad axis for onehot")
        return OpTreeNode.build("onehot", None, None, idx=indices, axis=axis, out=out)
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/backend.py/Backend.onehot/original