code: def optimize(ops, variables, shape_constraints):
      _normalize_ashapes(ops, variables, shape_constraints)
      ops = _reduce_memory_access(ops)
      ops = _fuse_consecutive_ops(ops, shape_constraints)
      ops = _reduce_memory_access(ops)
      return ops
  
imports: from cupy._core import _fusion_variable
  from cupy._core import _fusion_op
label_desc: Use image node_id 5 for calling a global function with example usage: optimize(ops, variables, shape_constraints) and returns: ops