Skip to content

Improve typing in engine #1513

@vfdev-5

Description

@vfdev-5

🚀 Feature

The following code may be fail if max_epochs is None:

"Current iteration: {} vs Total iterations to run : {}".format(
self.state.iteration,
self.state.epoch_length * self.state.max_epochs, # type: ignore[operator]
)

is_done_count = (
state.epoch_length is not None
and state.iteration >= state.epoch_length * state.max_epochs # type: ignore[operator]
)
is_done_epochs = state.max_epochs is not None and state.epoch >= state.max_epochs

Maybe, we have to add additional check of max_epochs is not None and remove # type: ignore[operator].

@gruebel what do you think ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions