Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tushuhei
Copy link
Member

@tushuhei tushuhei commented Dec 9, 2024

The latest mypy and jax combination yields the typing error as below. This fixes the issue by making it sure that the epsilon is a float.

scripts/train.py:26: error: Incompatible types in assignment (expression has
type "floating[Any]", variable has type "float")  [assignment]
    EPS: float = jnp.finfo(float).eps
                 ^~~~~~~~~~~~~~~~~~~~
scripts/finetune.py:30: error: Incompatible types in assignment (expression has
type "floating[Any]", variable has type "float")  [assignment]
    EPSILON: float = jnp.finfo(float).eps
                     ^~~~~~~~~~~~~~~~~~~~
Found 2 errors in 2 files (checked 23 source files)

Copy link
Collaborator

@kojiishi kojiishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@tushuhei tushuhei merged commit 73175af into main Dec 9, 2024
44 checks passed
@tushuhei tushuhei deleted the type-nit branch December 27, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants