Skip to content

Commit b7fd98c

Browse files
author
Abhinav Arora
committed
Fix some typos in python code
1 parent 8556834 commit b7fd98c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/paddle/v2/fluid/framework.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def dtype_is_floating(dtype):
3939
if not isinstance(dtype, core.DataType):
4040
dtype = convert_np_dtype_to_dtype_(dtype)
4141

42-
if (dtype == core.DataType.FP16 or dtype == core.DataType.FP16 or
42+
if (dtype == core.DataType.FP16 or dtype == core.DataType.FP32 or
4343
dtype == core.DataType.FP64):
4444
return True
4545
else:

python/paddle/v2/fluid/layer_helper.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def create_parameter(self, attr, shape, dtype, suffix='w',
120120
if initializer is not None:
121121
attr_copy['initializer'] = initializer
122122
else:
123-
attr_copy['initializer'] = _get_default_initializer(dtype)
123+
attr_copy['initializer'] = self._get_default_initializer(dtype)
124124
if attr_copy['name'] is None:
125125
attr_copy['name'] = unique_name(".".join([self.name, suffix]))
126126
self.startup_program.global_block().create_parameter(
@@ -204,8 +204,8 @@ def append_activation(self, input_var):
204204
attrs=act)
205205
return tmp
206206

207-
def _get_default_initializer(dtype):
208-
if dtype is None or dtype_is_floating(dtype) == True:
207+
def _get_default_initializer(self, dtype):
208+
if dtype is None or dtype_is_floating(dtype) is True:
209209
return XavierInitializer()
210210
else:
211211
# For integer and boolean types, initialize with all zeros

0 commit comments

Comments
 (0)