pytorchnewbie:

The first argument is not “engine”. Does this mean that somehow ignite checks the function passed into add_event_handler to see if the first argument is called “engine”? And if so, does the nomenclature have to be exactly called “engine” in order for it to pass the engine that add_event_handler is attached to to the function?


Yes, internally, we check the signature of attached function and see if we can bind the function with and without the Engine.
There are following options possible:

with engine only

@trainer.on(event)
def handler(engine):
    assert engine == trainer


with engine and additional variables

@trainer.on(event, v1, v2)
def handler(engine, v1, v2):
    assert engine == trainer


without engine

@trainer.on(event)
def handler():
    pass


without engine, but with variables

@trainer.on(event, v1, v2)
def handler(v1, v2):
    pass


And if so, does the nomenclature have to be exactly called “engine” in order for it to pass the engine that add_event_handler is attached to to the function?

Yes, if you would like to pass engine, it has to be the first argument.
Hope it is more clear