aimclub / GOLEM

Graph Optimiser for Learning and Evolution of Models
https://thegolem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
64 stars 7 forks source link

Seemingly incorrect variance in type variable for `GraphFunction` #264

Closed donRumata03 closed 7 months ago

donRumata03 commented 8 months ago

In https://github.com/aimclub/GOLEM/blob/68706bebbf0050c23a2d015821a276ddb6a2ae69/golem/core/optimisers/objective/objective.py#L10-L14

function input is covariant and the output is contravariant while for a subtype of function being able to work with supertype of Graph as an argument and output a subtype of R, the variances should be opposite.