Skip to content

Commit 566e5f1

Browse files
committed
rename use_gpu to data_in_gpu
1 parent 8c87ab7 commit 566e5f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/py_paddle/dataprovider_converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def __init__(self, input_type, pos):
3333
# Otherwise, trainer uses MultiGradientMachine which will transfer
3434
# data from CPU to GPU in the forward function, set data_in_gpu to
3535
# False in this case.
36-
self.data_in_gpu = True if swig_paddle.isUsingGpu() and (
37-
swig_paddle.getTrainerCount() == 1) else False
36+
self.data_in_gpu = swig_paddle.isUsingGpu(
37+
) and swig_paddle.getTrainerCount() == 1
3838

3939
def scan(self, dat):
4040
pass
@@ -63,7 +63,7 @@ def finish_scan(self, argument):
6363
if self.__mat__.dtype != numpy.float32:
6464
self.__mat__ = self.__mat__.astype(numpy.float32)
6565
m = swig_paddle.Matrix.createDenseFromNumpy(self.__mat__, True,
66-
self.use_gpu)
66+
self.data_in_gpu)
6767
argument.setSlotValue(self.pos, m)
6868

6969

@@ -115,7 +115,7 @@ def scan(self, dat):
115115
self.__ids__.append(dat)
116116

117117
def finish_scan(self, argument):
118-
ids = swig_paddle.IVector.create(self.__ids__, self.use_gpu)
118+
ids = swig_paddle.IVector.create(self.__ids__, self.data_in_gpu)
119119
assert isinstance(argument, swig_paddle.Arguments)
120120
argument.setSlotIds(self.pos, ids)
121121

0 commit comments

Comments
 (0)