def get_framework_info(info, logged_time, job_id):
    global global_tensors
    tensors = {}
    tensor_access_list = []
    global_time = 0
    parameter = []
    operator_execution_time = []
    for (tensor_info, input_tensor_id, operation_name, operation_id, is_parameter, inputs_of_model, _) in info:
        input_tensors = []
        for tensor_id in input_tensor_id:
            input_tensor = tensors[tensor_id]
            input_tensors.append(input_tensor)
        time_cost = get_predicted_execution_time(operation_name, inputs_of_model, logged_time[operation_id])
        for (output_tensor_id, output_tensor_size, shape) in tensor_info:
            output_tensor_size = (output_tensor_size / 1000000)
            operator_execution_time.append(time_cost)
            if (operation_name in optimizer_op):
                is_parameter = 1
            output_tensor = Tensor(tensor_id=output_tensor_id, job_id=job_id, size=output_tensor_size, source_tensors=input_tensors, recomputation_time=time_cost, is_parameter=is_parameter, shape=shape)
            output_access = TensorAccess(tensor=output_tensor, time=(global_time + time_cost), run_time=time_cost, access_type=AccessType.output, operation_id=operation_id, operation_name=operation_name)
            tensor_access_list.append(output_access)
            tensors[output_tensor.tensor_id] = output_tensor
            if is_parameter:
                parameter.append(output_tensor)
        for tensor_id in input_tensor_id:
            input_tensor = tensors[tensor_id]
            input_access = TensorAccess(tensor=input_tensor, time=global_time, run_time=time_cost, access_type=AccessType.input, operation_id=operation_id, operation_name=operation_name)
            tensor_access_list.append(input_access)
        global_time += time_cost
    tensors = list(tensors.values())
    global_tensors[job_id] = tensors
    tensor_access_list = sorted(tensor_access_list, key=(lambda x: x.time))
    dic = defaultdict(list)
    for access in tensor_access_list:
        dic[access.tensor].append(access)
    for (k, v) in dic.items():
        dic[k] = sorted(v, key=(lambda x: x.time))
    tensor_access_by_tensor[job_id] = dic
    swap_scheduler = []
    parameter = sorted(parameter, key=(lambda x: dic[x][0].start_time))
    return (tensor_access_list, swap_scheduler, parameter, operator_execution_time)
def get_framework_info(info, logged_time, job_id):
    global global_tensors
    tensors = {}
    tensor_access_list = []
    global_time = 0
    parameter = []
    operator_execution_time = []
    for (tensor_info, input_tensor_id, operation_name, operation_id, is_parameter, inputs_of_model, _) in info:
        input_tensors = []
        for tensor_id in input_tensor_id:
            input_tensor = tensors[tensor_id]
            input_tensors.append(input_tensor)
        time_cost = get_predicted_execution_time(operation_name, inputs_of_model, logged_time[operation_id])
        for (output_tensor_id, output_tensor_size, shape) in tensor_info:
            output_tensor_size = (output_tensor_size / 1000000)
            operator_execution_time.append(time_cost)
            if (operation_name in optimizer_op):
                is_parameter = 1
            output_tensor = Tensor(tensor_id=output_tensor_id, job_id=job_id, size=output_tensor_size, source_tensors=input_tensors, recomputation_time=time_cost, is_parameter=is_parameter, shape=shape)
            output_access = TensorAccess(tensor=output_tensor, time=(global_time + time_cost), run_time=time_cost, access_type=AccessType.output, operation_id=operation_id, operation_name=operation_name)
            tensor_access_list.append(output_access)
            tensors[output_tensor.tensor_id] = output_tensor
            if is_parameter:
                parameter.append(output_tensor)
        for tensor_id in input_tensor_id:
            input_tensor = tensors[tensor_id]
            input_access = TensorAccess(tensor=input_tensor, time=global_time, run_time=time_cost, access_type=AccessType.input, operation_id=operation_id, operation_name=operation_name)
            tensor_access_list.append(input_access)
        global_time += time_cost
    tensors = list(tensors.values())
    global_tensors[job_id] = tensors
    tensor_access_list = sorted(tensor_access_list, key=(lambda x: x.time))
    dic = defaultdict(list)
    for access in tensor_access_list:
        dic[access.tensor].append(access)
    for (k, v) in dic.items():
        dic[k] = sorted(v, key=(lambda x: x.time))
    tensor_access_by_tensor[job_id] = dic
    swap_scheduler = []
    parameter = sorted(parameter, key=(lambda x: dic[x][0].start_time))
    return (tensor_access_list, swap_scheduler, parameter, operator_execution_time)