未验证 提交 0d40a4db 编写于 作者: Y Yu Yang 提交者: GitHub

Add lod_level for data layer (#6040)

上级 4e564e48
...@@ -185,6 +185,7 @@ def data(name, ...@@ -185,6 +185,7 @@ def data(name,
shape, shape,
append_batch_size=True, append_batch_size=True,
dtype='float32', dtype='float32',
lod_level=0,
type=core.VarDesc.VarType.LOD_TENSOR, type=core.VarDesc.VarType.LOD_TENSOR,
main_program=None, main_program=None,
startup_program=None, startup_program=None,
...@@ -198,6 +199,7 @@ def data(name, ...@@ -198,6 +199,7 @@ def data(name,
append_batch_size: Whether or not to append the data as a batch. append_batch_size: Whether or not to append the data as a batch.
dtype: The type of data : float32, float_16, int etc dtype: The type of data : float32, float_16, int etc
type: The output type. By default it is LOD_TENSOR. type: The output type. By default it is LOD_TENSOR.
lod_level(int): The LoD Level. 0 means the input data is not a sequence.
main_program: Name of the main program that calls this main_program: Name of the main program that calls this
startup_program: Name of the startup program startup_program: Name of the startup program
stop_gradient: A boolean that mentions whether gradient should flow. stop_gradient: A boolean that mentions whether gradient should flow.
...@@ -228,7 +230,8 @@ def data(name, ...@@ -228,7 +230,8 @@ def data(name,
shape=shape, shape=shape,
dtype=dtype, dtype=dtype,
type=type, type=type,
stop_gradient=stop_gradient) stop_gradient=stop_gradient,
lod_level=lod_level)
def create_tensor(dtype, name=None, main_program=None, startup_program=None): def create_tensor(dtype, name=None, main_program=None, startup_program=None):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册