Skip to content

Commit 760c953

Browse files
committed
Merge branch 'master' of https://github.com/vacancy/Jacinle
* 'master' of https://github.com/vacancy/Jacinle: [master] import bug fix [master] remove debug prints [master] fix default collator? [master] add iterable mixin for filterable datasets
2 parents 5b4e0d5 + c9fcbb5 commit 760c953

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

jaclearn/visualize/html_table.py

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def row(self, *args, **kwargs):
142142
elif c.type == 'text' or c.type == 'code':
143143
tag = 'pre' if c.type == 'code' else 'div'
144144
self._print(' <{} class="{}">{}</{}>'.format(tag, classname, obj, tag))
145+
elif c.type == 'raw':
146+
self._print(' {}'.format(obj))
145147
else:
146148
raise ValueError('Unknown column type: {}.'.format(c.type))
147149
self._print(' </td>')

jactorch/data/dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __len__(self):
7070
return len(self.list)
7171

7272

73-
class FilterableDatasetUnwrapped(Dataset):
73+
class FilterableDatasetUnwrapped(Dataset, IterableDatasetMixin):
7474
"""
7575
A filterable dataset. User can call various `filter_*` operations to obtain a subset of the dataset.
7676
"""

jactorch/parallel/dict_gather.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import functools
1313
import collections
1414

15+
import torch
1516
from torch.autograd import Variable
1617
from torch.nn.parallel.data_parallel import DataParallel
1718
from torch.nn.parallel._functions import Gather

jactorch/train/env.py

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def cuda_time(sync=True):
3333
def default_reduce_func(k, v):
3434
if torch.is_tensor(v):
3535
return v.mean()
36+
return v
3637

3738

3839
class TrainerEnv(object):

0 commit comments

Comments
 (0)