Closed huzecong closed 3 years ago
Merging #319 into master will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #319 +/- ##
=======================================
Coverage 79.91% 79.92%
=======================================
Files 133 133
Lines 11135 11143 +8
=======================================
+ Hits 8899 8906 +7
- Misses 2236 2237 +1
Impacted Files | Coverage Δ | |
---|---|---|
texar/torch/run/metric/base_metric.py | 77.38% <100.00%> (+2.38%) |
:arrow_up: |
texar/torch/data/data/data_iterators.py | 81.88% <0.00%> (-0.37%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update fcd3aa0...7dc536f. Read the comment docs.
This PR fixes #318: cannot pickle metrics in Python 3.6.
In Python 3.6 and below, pickling a
Generic
subclass that is specialized (e.g.,Accuracy[float]
) would cause an exception. To prevent troubles withExecutor
save & load, we use a dummy implementation ofGeneric
through our home-brewGenericMeta
. Basically, it is modified so that for any classFoo
that inherits fromGeneric
,Foo[T]
just returnsFoo
.Additional unit tests are also added to verify pickling behavior.