diff --git a/python/paddle/v2/fluid/layer_helper.py b/python/paddle/v2/fluid/layer_helper.py index cc4822735aa996f3caf81fefa78da43a416d4579..2119ca12c8dea6463934aa68cb1b46ec687e3f72 100644 --- a/python/paddle/v2/fluid/layer_helper.py +++ b/python/paddle/v2/fluid/layer_helper.py @@ -226,8 +226,8 @@ class LayerHelper(object): scale = elementwise_div( x=g, y=norm) # The shapes of g and norm are the same. # Currently, elementwise_mul only support broadcast when the shape - # of y is a subset of x. Thus, we should reshape y to squeeze to - # achive it. + # of y is a subset of the shape of x. Thus, we reshape y to squeeze + # to achive the subset. w = elementwise_mul( x=v, y=scale if dim is None else reshape( diff --git a/python/paddle/v2/fluid/param_attr.py b/python/paddle/v2/fluid/param_attr.py index 1218e71ca1012656672f526cf195c5156d64f662..fc566b8a2480ce9256d610b4731405cd6d89b7e4 100644 --- a/python/paddle/v2/fluid/param_attr.py +++ b/python/paddle/v2/fluid/param_attr.py @@ -15,7 +15,10 @@ from initializer import Initializer, Xavier, Constant from regularizer import WeightDecayRegularizer -__all__ = ['ParamAttr'] +__all__ = [ + 'ParamAttr', + 'WeightNormParamAttr', +] class ParamAttr(object): @@ -92,7 +95,7 @@ class WeightNormParamAttr(ParamAttr): """ # List to record the parameters reparameterized by weight normalization. # If these parameters are treated as Variable rather than Parameter, - # it can be used to discriminate these parameters and help to serialize + # it can be used to discriminate these parameters and help to serialize # these paramters for inference. params_with_weight_norm = [] diff --git a/python/paddle/v2/fluid/tests/test_weight_normalization.py b/python/paddle/v2/fluid/tests/test_weight_normalization.py index 200b5b9dc064d839301d2b3d1534f3ed6ac4a1a6..1ac54ea3050c9d3f0d7a1d7700b7659193f6efc2 100644 --- a/python/paddle/v2/fluid/tests/test_weight_normalization.py +++ b/python/paddle/v2/fluid/tests/test_weight_normalization.py @@ -52,7 +52,7 @@ class TestWeightNormalization(unittest.TestCase): def run_program(self): outputs = [] places = [core.CPUPlace()] - if core.is_compile_gpu(): + if core.is_compiled_with_cuda(): places.append(core.CUDAPlace(0)) for place in places: self.set_inputs(place)