Skip to content

Commit

Permalink
Merge pull request #19 from hyp1231/master
Browse files Browse the repository at this point in the history
REFACTOR: data & sampler & dataloader
  • Loading branch information
hyp1231 authored Jul 7, 2020
2 parents f4f3c45 + 224dfad commit ca15bc8
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 375 deletions.
2 changes: 1 addition & 1 deletion data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .dataset import *
from .data import Data
from .dataloader import *
209 changes: 0 additions & 209 deletions data/data.py

This file was deleted.

17 changes: 17 additions & 0 deletions data/dataloader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# @Author : Yupeng Hou
# @Email : houyupeng@ruc.edu.cn
# @File : dataloader.py

from torch.utils import data
from sampler import Sampler

class AbstractDataLoader(data.DataLoader):
def __init__(self, config, dataset):
self.config = config
self.dataset = dataset
self.sampler = Sampler(config, dataset)

class PairwiseDataLoader(AbstractDataLoader):
def __init__(self, config, dataset):
super(PairwiseDataLoader, self).__init__(config, dataset)
Loading

0 comments on commit ca15bc8

Please sign in to comment.