code: def local_Unique_Alloc_lift(fgraph, node):
      """Convert ``unique(alloc(x, ...), axis=None)`` to ``unique(x, axis=None)``.
  
      This isn't really so much a lift as a "reduction/consumption".
      """
      if not isinstance(node.op, Unique):
          return False
  
      if (
          node.op.return_index
          or node.op.return_inverse
          or node.op.return_counts
          or node.op.axis is not None
      ):
          return False
  
      alloc_var = node.inputs[0]
  
      if not (
          alloc_var.owner and isinstance(alloc_var.owner.op, Alloc)
      ):
          return False
  
      alloced_var, *alloc_shape = alloc_var.owner.inputs
  
      new_unique, *_ = node.op.make_node(alloced_var).outputs
  
      old_out = node.outputs[0]
      new_x = as_tensor_variable(
          new_unique, ndim=old_out.ndim, dtype=old_out.dtype
      )
      return [new_x]
  
file_path: pytensor/pytensor/tensor/rewriting/extra_ops.py
imports: import pytensor.scalar.basic
  from pytensor.graph.rewriting.basic import node_rewriter
  from pytensor.tensor.basic import Alloc, as_tensor_variable
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.extra_ops import Repeat, Unique
  from pytensor.tensor.rewriting.basic import register_canonicalize, register_useless
label_desc: Use image node_id 2 for calling a global function with example usage: local_Unique_Alloc_lift(fgraph, node) and returns: list, False, False, False