MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / data_loader

Function data_loader

PyTorch-VAE/utils.py:8–22  ·  view source on GitHub ↗

Decorator to handle the deprecation of data_loader from 0.7 :param fn: User defined data loader function :return: A wrapper for the data_loader function

(fn)

Source from the content-addressed store, hash-verified

6
7
8def data_loader(fn):
9 """
10 Decorator to handle the deprecation of data_loader from 0.7
11 :param fn: User defined data loader function
12 :return: A wrapper for the data_loader function
13 """
14
15 def func_wrapper(self):
16 try: # Works for version 0.6.0
17 return pl.data_loader(fn)(self)
18
19 except: # Works for version > 0.6.0
20 return fn(self)
21
22 return func_wrapper

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected