def METHOD_NAME(self, net, value, forward_only):
    num_found = 0
    for op in net.Proto().op:
        if op.type.startswith("RecurrentNetwork"):
            for arg in op.arg:
                if arg.name == 'enable_rnn_executor':
                    arg.i = value
                    num_found += 1
    # This sanity check is so that if someone changes the
    # enable_rnn_executor parameter name, the test will
    # start failing as this function will become defective.
    self.assertEqual(1 if forward_only else 2, num_found)