class_docstr: Detect the following patterns that can be mapped to a ``prelu`` op.
  Essentially, the ``prelu`` op can be broken down into the following ops:
  
  ``y = a * relu(-1 * x) + relu(x)``
  
  `Pattern 1`
  
  .. code-block::
  
                        | ------------> relu --------------------|
                        |                                        V
         x (BCHW) ------|                                       add -----> y (BCHW)
                        |                                        ^
                        --------> mul -------> relu -----> mul---|
                                   ^                        ^
                                   |                        |
                              Const(val=-1)            Const(name=a, shape=(C,1,1) or (1,C,1,1))
  
  
  This will be mapped to:
  
  .. code-block::
  
          x (BCHW) ------> prelu(alpha=a, shape=(C,)) ---------> y (BCHW)
  
  
  `Pattern 2`
  
  .. code-block::
  
                                        | ------------> relu --------------------|
                                        |                                        V
        x (BCHW) -->transpose(BHWC)---->|                                       add -----> y (BHWC)
                                        |                                        ^
                                        --------> mul -------> relu -----> mul---|
                                                   ^                        ^
                                                   |                        |
                                          Const(val=-1)    Const(shape=(C,) or (1,C) or (1,1,C) or (1,1,1,C))
  
  
  This will be mapped to:
  
  .. code-block::
  
          x (BCHW) ------> prelu ---------> transpose ------> y (BHWC)
class_docstr_tok: ["Detect","the","following","patterns","that","can","be","mapped","to","a","``","prelu","``","op",".","Essentially",",","the","``","prelu","``","op","can","be","broken","down","into","the","following","ops",":","``","y","=","a","*","relu","(","-1","*","x",")","+","relu","(","x",")","``","`","Pattern","1","`","..","code-block",":",":","|","--","--","--","--","--","--",">","relu","--","--","--","--","--","--","--","--","--","--","|","|","V","x","(","BCHW",")","--","--","--","|","add","--","--","-",">","y","(","BCHW",")","|","^","--","--","--","--",">","mul","--","--","--","-",">","relu","--","--","-",">","mul","--","-|","^","^","|","|","Const","(","val=-1",")","Const","(","name=a",",","shape=","(","C,1,1",")","or","(","1",",","C,1,1",")",")","This","will","be","mapped","to",":","..","code-block",":",":","x","(","BCHW",")","--","--","--",">","prelu","(","alpha=a",",","shape=","(","C",",",")",")","--","--","--","--","-",">","y","(","BCHW",")","`","Pattern","2","`","..","code-block",":",":","|","--","--","--","--","--","--",">","relu","--","--","--","--","--","--","--","--","--","--","|","|","V","x","(","BCHW",")","--",">","transpose","(","BHWC",")","--","--",">","|","add","--","--","-",">","y","(","BHWC",")","|","^","--","--","--","--",">","mul","--","--","--","-",">","relu","--","--","-",">","mul","--","-|","^","^","|","|","Const","(","val=-1",")","Const","(","shape=","(","C",",",")","or","(","1",",","C",")","or","(","1,1",",","C",")","or","(","1,1,1",",","C",")",")","This","will","be","mapped","to",":","..","code-block",":",":","x","(","BCHW",")","--","--","--",">","prelu","--","--","--","--","-",">","transpose","--","--","--",">","y","(","BHWC",")"]
code: def _prelu_pattern(x):
      # MIL operation takes named inputs (instead of positional inputs).
      # Here `name` argument is MANDATORY.
      neg = mb.mul(x=x, y=-1.0, name="neg")
      relu1 = mb.relu(x=neg, name="relu1")
      # Use any constant here to match, rank and shape will be verified in
      # `is_var_constraint_satisifed`.
      mul = mb.mul(
          x=relu1, y=np.random.rand(2, 2, 2, 2), name="alpha_mul"
      )
      relu2 = mb.relu(x=x, name="relu2")
      out = mb.add(x=relu2, y=mul, name="out_op")
      return out
  
imports: import numpy
  from coremltools.converters.mil.experimental.passes.generic_pass_infrastructure import fuse_all_blocks
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import _check_child_op_type, _check_var_scalar_value, _check_var_scalar_value_in_interval, block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 2 for calling the fuse_prelu obj's underlying member method code with example usage: obj._prelu_pattern(x) and returns: out