def METHOD_NAME(user_ops, item_ops):
  queue_item = collections.deque()
  queue_item.extend(item_ops)
  queue_item_back = collections.deque()
  item_sets = set()
  processed_item = set()
  while queue_item:
    op = queue_item.popleft()
    if control_flow_util.IsInWhileLoop(op):
      input_ops = []
      for t in op.inputs:
        input_ops.append(t.op)
      queue_item_back.extend(input_ops)
    if op in processed_item:
      continue
    processed_item.add(op)
    for t in op.outputs:
      item_sets = (item_sets|set(t.consumers()))
      queue_item.extend(t.consumers())
  processed_item = set()
  while queue_item_back:
    op = queue_item_back.popleft()
    if op in processed_item:
      continue
    if control_flow_util.IsInWhileLoop(op):
      input_ops = []
      for t in op.inputs:
        input_ops.append(t.op)
      for t in op.outputs:
        input_ops.append(t.op)
      queue_item_back.extend(input_ops)
      item_sets.add(op)
      processed_item.add(op)
  queue_user = collections.deque()
  queue_user.extend(user_ops)
  user_sets = set()
  boundery_tensor_sets = set()
  while queue_user:
    op = queue_user.popleft()
    for t in op.outputs:
      for op2 in t.consumers():
        if op2 in user_sets:
          continue
        if op2 in item_sets:
          boundery_tensor_sets.add(t)
        else:
          user_sets.add(op2)
          queue_user.append(op2)
  logging.info("[SampleAwaredGraphCompression] boundery_tensor_sets: %s", boundery_tensor_sets)
  return user_sets, item_sets, boundery_tensor_sets