code: def local_Unique_scalar(fgraph, node):
      """Convert ``unique(x)`` to ``x`` when ``x`` is a scalar."""
      if not isinstance(node.op, Unique):
          return False
  
      if (
          node.op.return_index
          or node.op.return_inverse
          or node.op.return_counts
      ):
          return False
  
      uniqued_var = node.inputs[0]
  
      if uniqued_var.ndim != 0:
          return False
  
      old_out = node.outputs[0]
      res = as_tensor_variable(
          uniqued_var, ndim=old_out.ndim, dtype=old_out.dtype
      )
      return [res]
  
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 1 for calling a global function with example usage: local_Unique_scalar(fgraph, node) and returns: list, False, False, False