MetricsCollection
is not Pytorch JIT-able due to its metric_state
property
#2812
Labels
MetricsCollection
is not Pytorch JIT-able due to its metric_state
property
#2812
🐛 Bug
When attempting to run
torch.jit.script
on any modules that have aMetricsCollection
object. You would run into an error something akin to the followingTo Reproduce
Steps to reproduce the behavior...
Code sample
Expected behavior
This should run and compile properly without error.
Environment
Additional context
Most likely the issue is due to
When I comment out
@property
, this works but it would also break the style of acquiringmetric_state
like it is withMetrics
class. It can also be due to the fact that theitem()
property has been redefined and torch JIT does not like that. Not sure what the best fix is for this though.The text was updated successfully, but these errors were encountered: