'Returns the intrinsic key, tensor_index_map and index_tensor_map
for the purpose of identifying a optree. The key is depended on the ops
tensors dimensions and the relaion among the tensors.
x0 * x1 + x0 * x2 will have the same intrinsic key as y0 * y1 + y0 * y2,
if xi and yi have the same shape.
In tensor_index_map and index_tensor_map, tensors has a one-to-one
mapping with indices. The index of the tensor is depended on the first
occurance of the tensor in the post-order traversal of the optree.
Returns:
(intrinsic_key, tensor_index_map, index_tensor_map)'

def intrinsic_key_maps(self):

    stack = self.traverse(list())
    tensor_index = 0
    tensor_index_map = {}
    index_tensor_map = {}
    for i in range(len(stack)):
        if (type(stack[i]) is dict):
            if ('axis' in stack[i]):
                stack[i] = (stack[i]['op'], stack[i]['axis'])
            else:
                stack[i] = stack[i]['op']
        elif isinstance(stack[i], Tensor):
            if (stack[i] in tensor_index_map):
                stack[i] = (tensor_index_map[stack[i]], stack[i].shape)
            else:
                tensor_index_map[stack[i]] = tensor_index
                index_tensor_map[tensor_index] = stack[i]
                stack[i] = (tensor_index, stack[i].shape)
                tensor_index += 1
    return (tuple(stack), tensor_index_map, index_tensor_map)
