Skip to content

Commit

Permalink
rename use_gpu to data_in_gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
qingqing01 committed Mar 1, 2017
1 parent 8c87ab7 commit 566e5f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions paddle/py_paddle/dataprovider_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, input_type, pos):
# Otherwise, trainer uses MultiGradientMachine which will transfer
# data from CPU to GPU in the forward function, set data_in_gpu to
# False in this case.
self.data_in_gpu = True if swig_paddle.isUsingGpu() and (
swig_paddle.getTrainerCount() == 1) else False
self.data_in_gpu = swig_paddle.isUsingGpu(
) and swig_paddle.getTrainerCount() == 1

def scan(self, dat):
pass
Expand Down Expand Up @@ -63,7 +63,7 @@ def finish_scan(self, argument):
if self.__mat__.dtype != numpy.float32:
self.__mat__ = self.__mat__.astype(numpy.float32)
m = swig_paddle.Matrix.createDenseFromNumpy(self.__mat__, True,
self.use_gpu)
self.data_in_gpu)
argument.setSlotValue(self.pos, m)


Expand Down Expand Up @@ -115,7 +115,7 @@ def scan(self, dat):
self.__ids__.append(dat)

def finish_scan(self, argument):
ids = swig_paddle.IVector.create(self.__ids__, self.use_gpu)
ids = swig_paddle.IVector.create(self.__ids__, self.data_in_gpu)
assert isinstance(argument, swig_paddle.Arguments)
argument.setSlotIds(self.pos, ids)

Expand Down

0 comments on commit 566e5f1

Please sign in to comment.