提交 7840d181 编写于 作者: P peizhilin

fix style issue

上级 dc339b78
../../../CONTRIBUTING.md ../../../CONTRIBUTING.md
\ No newline at end of file
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
data_type_transform.cc data_type_transform.cc
\ No newline at end of file
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
tensor_util.cc tensor_util.cc
\ No newline at end of file
...@@ -150,4 +150,4 @@ struct NCCLContextMap { ...@@ -150,4 +150,4 @@ struct NCCLContextMap {
} // namespace platform } // namespace platform
} // namespace paddle } // namespace paddle
#endif #endif
\ No newline at end of file
...@@ -49,4 +49,4 @@ limitations under the License. */ ...@@ -49,4 +49,4 @@ limitations under the License. */
#define __builtin_expect(EXP, C) (EXP) #define __builtin_expect(EXP, C) (EXP)
#else #else
#define UNUSED __attribute__((unused)) #define UNUSED __attribute__((unused))
#endif #endif
\ No newline at end of file
...@@ -112,11 +112,10 @@ def __bootstrap__(): ...@@ -112,11 +112,10 @@ def __bootstrap__():
os.environ['OMP_NUM_THREADS'] = str(num_threads) os.environ['OMP_NUM_THREADS'] = str(num_threads)
read_env_flags = [ read_env_flags = [
'use_pinned_memory', 'check_nan_inf', 'benchmark', 'use_pinned_memory', 'check_nan_inf', 'benchmark', 'eager_delete_scope',
'eager_delete_scope', 'use_mkldnn', 'initial_cpu_memory_in_mb', 'use_mkldnn', 'initial_cpu_memory_in_mb', 'init_allocated_mem',
'init_allocated_mem', 'free_idle_memory', 'paddle_num_threads', 'free_idle_memory', 'paddle_num_threads', 'dist_threadpool_size',
'dist_threadpool_size', 'eager_delete_tensor_gb', 'eager_delete_tensor_gb', 'reader_queue_speed_test_mode'
'reader_queue_speed_test_mode'
] ]
if os.name != 'nt': if os.name != 'nt':
read_env_flags.append('warpctc_dir') read_env_flags.append('warpctc_dir')
......
...@@ -348,6 +348,7 @@ def _copy_reader_create_op_(block, op): ...@@ -348,6 +348,7 @@ def _copy_reader_create_op_(block, op):
if os.name != 'nt': if os.name != 'nt':
@templatedoc(op_type='create_recordio_file_reader') @templatedoc(op_type='create_recordio_file_reader')
def open_recordio_file(filename, def open_recordio_file(filename,
shapes, shapes,
...@@ -405,8 +406,8 @@ if os.name != 'nt': ...@@ -405,8 +406,8 @@ if os.name != 'nt':
startup_var.desc.set_dtypes(dtypes) startup_var.desc.set_dtypes(dtypes)
startup_var.persistable = True startup_var.persistable = True
main_prog_var = _copy_reader_var_(default_main_program().current_block(), main_prog_var = _copy_reader_var_(
startup_var) default_main_program().current_block(), startup_var)
if pass_num > 1: if pass_num > 1:
main_prog_var = multi_pass(reader=main_prog_var, pass_num=pass_num) main_prog_var = multi_pass(reader=main_prog_var, pass_num=pass_num)
......
...@@ -342,6 +342,7 @@ def embedding(input, ...@@ -342,6 +342,7 @@ def embedding(input,
if os.name != 'nt': if os.name != 'nt':
@templatedoc(op_type="lstm") @templatedoc(op_type="lstm")
def dynamic_lstm(input, def dynamic_lstm(input,
size, size,
...@@ -961,6 +962,7 @@ def linear_chain_crf(input, label, param_attr=None): ...@@ -961,6 +962,7 @@ def linear_chain_crf(input, label, param_attr=None):
if os.name != 'nt': if os.name != 'nt':
@templatedoc() @templatedoc()
def crf_decoding(input, param_attr, label=None): def crf_decoding(input, param_attr, label=None):
""" """
...@@ -988,9 +990,11 @@ if os.name != 'nt': ...@@ -988,9 +990,11 @@ if os.name != 'nt':
dtype=helper.input_dtype()) dtype=helper.input_dtype())
helper.append_op( helper.append_op(
type='crf_decoding', type='crf_decoding',
inputs={"Emission": [input], inputs={
"Transition": transition, "Emission": [input],
"Label": label}, "Transition": transition,
"Label": label
},
outputs={"ViterbiPath": [viterbi_path]}) outputs={"ViterbiPath": [viterbi_path]})
return viterbi_path return viterbi_path
...@@ -5530,8 +5534,13 @@ def label_smooth(label, ...@@ -5530,8 +5534,13 @@ def label_smooth(label,
if os.name != 'nt': if os.name != 'nt':
@templatedoc() @templatedoc()
def roi_pool(input, rois, pooled_height=1, pooled_width=1, spatial_scale=1.0): def roi_pool(input,
rois,
pooled_height=1,
pooled_width=1,
spatial_scale=1.0):
""" """
${comment} ${comment}
......
...@@ -105,7 +105,6 @@ if os.name != 'nt': ...@@ -105,7 +105,6 @@ if os.name != 'nt':
_cum_sum_ = generate_layer_fn('cumsum') _cum_sum_ = generate_layer_fn('cumsum')
def cumsum(x, axis=None, exclusive=None, reverse=None): def cumsum(x, axis=None, exclusive=None, reverse=None):
locals_var = locals().keys() locals_var = locals().keys()
kwargs = dict() kwargs = dict()
...@@ -115,7 +114,6 @@ if os.name != 'nt': ...@@ -115,7 +114,6 @@ if os.name != 'nt':
kwargs[name] = val kwargs[name] = val
return _cum_sum_(**kwargs) return _cum_sum_(**kwargs)
cumsum.__doc__ = _cum_sum_.__doc__ + """ cumsum.__doc__ = _cum_sum_.__doc__ + """
Examples: Examples:
......
...@@ -1719,7 +1719,7 @@ def inputs(layers, *args): ...@@ -1719,7 +1719,7 @@ def inputs(layers, *args):
if len(args) != 0: if len(args) != 0:
layers.extend(args) layers.extend(args)
Inputs(*[l.name for l in layers]) Inputs(* [l.name for l in layers])
def outputs(layers, *args): def outputs(layers, *args):
...@@ -1769,7 +1769,7 @@ def outputs(layers, *args): ...@@ -1769,7 +1769,7 @@ def outputs(layers, *args):
assert len(layers) > 0 assert len(layers) > 0
if HasInputsSet(): # input already set if HasInputsSet(): # input already set
Outputs(*[l.name for l in layers]) Outputs(* [l.name for l in layers])
return # just return outputs. return # just return outputs.
if len(layers) != 1: if len(layers) != 1:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册