def METHOD_NAME(self, inputs, *args, **kwargs):
    selected_op = self._random_generator.random_uniform(
        (), minval=0, maxval=len(self.layers), dtype=tf.int32
    )
    # Warning:
    # Do not replace the currying function with a lambda.
    # Originally we used a lambda, but due to Python's
    # lack of loop level scope this causes unexpected
    # behavior running outside of graph mode.
    #
    # Autograph has an edge case where the behavior of Python for loop
    # variables is inconsistent between Python and graph execution.
    # By using a list comprehension and currying, we mitigate
    # our code against both of these cases.
    branch_fns = [
        (i, self._curry_call_layer(inputs, layer))
        for (i, layer) in enumerate(self.layers)
    ]
    return tf.switch_case(
        branch_index=selected_op,
        branch_fns=branch_fns,
        default=lambda: inputs,
    )