Skip to content

Commit 37cc8b3

Browse files
authored
Change LOD_TENSOR to DENSE_TENSOR
1 parent b770c8b commit 37cc8b3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

paddleslim/common/recover_program.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _recover_outputs_attr(program):
4545
unique_name.generate_with_ignorable_key(
4646
".".join(["reserve_space", 'tmp'])),
4747
dtype=block.var(op.input("X")[0]).dtype,
48-
type=paddle.framework.core.VarDesc.VarType.LOD_TENSOR,
48+
type=paddle.framework.core.VarDesc.VarType.DENSE_TENSOR,
4949
persistable=False,
5050
stop_gradient=True)
5151
op.desc.set_output("ReserveSpace", [reserve_space.name])
@@ -56,7 +56,7 @@ def _recover_outputs_attr(program):
5656
unique_name.generate_with_ignorable_key(
5757
".".join(["xshape", 'tmp'])),
5858
dtype=block.var(op.input("X")[0]).dtype,
59-
type=paddle.framework.core.VarDesc.VarType.LOD_TENSOR,
59+
type=paddle.framework.core.VarDesc.VarType.DENSE_TENSOR,
6060
shape=(0, ) + block.var(op.input("X")[0]).shape,
6161
persistable=False,
6262
stop_gradient=True)
@@ -67,7 +67,7 @@ def _recover_outputs_attr(program):
6767
name=paddle.utils.unique_name.
6868
generate_with_ignorable_key(".".join(["mask", 'tmp'])),
6969
dtype=block.var(op.input("X")[0]).dtype,
70-
type=paddle.framework.core.VarDesc.VarType.LOD_TENSOR,
70+
type=paddle.framework.core.VarDesc.VarType.DENSE_TENSOR,
7171
shape=block.var(op.input("X")[0]).shape,
7272
persistable=False,
7373
stop_gradient=True)

paddleslim/quant/quant_embedding.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def _split_embedding_seq_pool(graph, op):
397397
out = outputs[0]
398398
lookup_out = graph.create_var_node(
399399
name=ids.name() + '.look_up_table.out',
400-
var_type=paddle.framework.core.VarDesc.VarType.LOD_TENSOR,
400+
var_type=paddle.framework.core.VarDesc.VarType.DENSE_TENSOR,
401401
shape=[1],
402402
var_dtype=weight.dtype())
403403
lookup_table_op = graph.create_op_node(
@@ -415,7 +415,7 @@ def _split_embedding_seq_pool(graph, op):
415415
graph.link_to(lookup_table_op, lookup_out)
416416
max_index = graph.create_var_node(
417417
name=ids.name() + '.seq_pool_op.max_index',
418-
var_type=paddle.framework.core.VarDesc.VarType.LOD_TENSOR,
418+
var_type=paddle.framework.core.VarDesc.VarType.DENSE_TENSOR,
419419
shape=[1],
420420
var_dtype=weight.dtype())
421421

paddleslim/quant/quanters/channel_wise_abs_max.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def static_forward(self, input):
136136
quant_out = self._helper.create_variable(
137137
name=f"{input.name}.quantized.dequantized",
138138
dtype=input.dtype,
139-
type=core.VarDesc.VarType.LOD_TENSOR,
139+
type=core.VarDesc.VarType.DENSE_TENSOR,
140140
persistable=False,
141141
stop_gradient=False, )
142142
outputs = {"Out": [quant_out], "OutScale": [self._scale]}

0 commit comments

Comments
 (0)