code: def vectorize_softmax_node(op, node, batched_x):
      """
      Vectorize Softmax and LogSoftmax nodes.
  
      """
      core_ndim = node.inputs[0].type.ndim
      batch_ndim = batched_x.type.ndim - core_ndim
  
      if not batch_ndim:
          return op.make_node(batched_x)
  
      batch_axes = get_normalized_batch_axes(
          op.axis, core_ndim, batch_ndim
      )
  
      if len(batch_axes) > 1:
          from pytensor.tensor.blockwise import vectorize_node_fallback
  
          # The softmax Ops only allow a specific axis (integer) or all axis (None).
          # If the vectorized operation requires more than one axis we have to default to a Blockwise
          return vectorize_node_fallback(op, node, batched_x)
  
      [batch_axis] = batch_axes
      return type(op)(axis=batch_axis).make_node(batched_x)
  
imports: from textwrap import dedent
  import numpy
  import scipy
  from pytensor.graph.basic import Apply
  from pytensor.graph.replace import _vectorize_node
  from pytensor.link.c.op import COp
  from pytensor.tensor.basic import as_tensor_variable
  from pytensor.tensor.elemwise import get_normalized_batch_axes
  from pytensor.tensor.math import gamma, gammaln, neg, sum
label_desc: Use image node_id 3 for calling a global function with example usage: vectorize_softmax_node(op, node, batched_x) and returns: type, op, vectorize_node_fallback