Skip to content

Trainer.profiler should allow str #3330

@carmocca

Description

@carmocca

🚀 Feature

Currently, the profile argument of the Trainer is bool. It should be Union[bool, str].

Motivation

It would avoid having to set the profiler manually by creating and passing the object to the Trainer.
It is also the way auto_scale_batch_size and auto_lr_find work.

Pitch

# equivalent to --profiler true
trainer = Trainer(profiler=True)

# equivalent to --profiler simple
trainer = Trainer(profiler=SimpleProfiler())

# equivalent to --profiler advanced
trainer = Trainer(profiler=AdvancedProfiler())

Metadata

Metadata

Assignees

Labels

featureIs an improvement or enhancementgood first issueGood for newcomershelp wantedOpen to be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions