Skip to content

Commit 777a281

Browse files
committed
Fix CI and enhance gitignore
1 parent 5f1a577 commit 777a281

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ third_party/
2727
cmake-build-*
2828

2929
# generated while compiling
30-
python/paddle/v2/fluid/core.so
3130
paddle/pybind/pybind.h
3231
CMakeFiles
3332
cmake_install.cmake

python/paddle/fluid/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
proto
2+
core.so

python/paddle/fluid/layers/layer_function_generator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def generate_layer_fn(op_type):
130130
o_name = not_intermediate_outputs[0].name
131131
intermediate_output_names = [output.name for output in intermediate_outputs]
132132

133-
def infer_and_check_dtype(op_proto, **kwargs):
133+
def infer_and_check_dtype(op_proto, *args, **kwargs):
134134
"""
135135
This function performs the sanity check for dtype and
136136
instance type.
@@ -141,6 +141,10 @@ def infer_and_check_dtype(op_proto, **kwargs):
141141
val = kwargs.pop(name, [])
142142
if not isinstance(val, list) and not isinstance(val, tuple):
143143
val = [val]
144+
if len(val) == 0:
145+
val = [args[0]]
146+
args = args[1:]
147+
144148
for each in val:
145149
if not isinstance(each, Variable):
146150
raise ValueError("input of {0} must be variable".format(
@@ -158,7 +162,7 @@ def infer_and_check_dtype(op_proto, **kwargs):
158162
def func(*args, **kwargs):
159163
helper = LayerHelper(op_type, **kwargs)
160164

161-
dtype = infer_and_check_dtype(op_proto, **kwargs)
165+
dtype = infer_and_check_dtype(op_proto, *args, **kwargs)
162166

163167
inputs = dict()
164168
for ipt in op_proto.inputs:

0 commit comments

Comments
 (0)