Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify how Optimizers are re-exported in train.ts #7156

Merged
merged 1 commit into from Dec 12, 2022

Commits on Dec 12, 2022

  1. Simplify how Optimizers are re-exported in train.ts

    `train.ts` exports optimizers by copying them from the `OptimizerConstructors` class onto a `train` object. This is unnecessary because the `OptimizerConstructors` class constructor is a subtype of the `train` object's type (i.e. it has all the properties that `train` has). Instead of creating a new `train` object, this PR re-exports `OptimizerConstructors` as `train`.
    
    This has no direct effect now, but if / when re remove the `sideEffects` field from `package.json`, it helps some bundlers (esbuild) do tree-shaking.
    mattsoulanille committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    6247096 View commit details
    Browse the repository at this point in the history