提交 a1957c11 编写于 作者: X xjqbest

fix

上级 a3ddeec0
...@@ -159,6 +159,8 @@ class Model(object): ...@@ -159,6 +159,8 @@ class Model(object):
name = "dataset." + kwargs.get("dataset_name") + "." name = "dataset." + kwargs.get("dataset_name") + "."
sparse_slots = envs.get_global_env(name + "sparse_slots", "").strip() sparse_slots = envs.get_global_env(name + "sparse_slots", "").strip()
dense_slots = envs.get_global_env(name + "dense_slots", "").strip() dense_slots = envs.get_global_env(name + "dense_slots", "").strip()
self._sparse_data_var_map = {}
self._dense_data_var_map = {}
if sparse_slots != "" or dense_slots != "": if sparse_slots != "" or dense_slots != "":
if sparse_slots == "": if sparse_slots == "":
sparse_slots = [] sparse_slots = []
...@@ -181,12 +183,14 @@ class Model(object): ...@@ -181,12 +183,14 @@ class Model(object):
dtype="float32") dtype="float32")
data_var_.append(l) data_var_.append(l)
self._dense_data_var.append(l) self._dense_data_var.append(l)
self._dense_data_var_map[dense_slots[i]] = l
self._sparse_data_var = [] self._sparse_data_var = []
for name in sparse_slots: for name in sparse_slots:
l = fluid.layers.data( l = fluid.layers.data(
name=name, shape=[1], lod_level=1, dtype="int64") name=name, shape=[1], lod_level=1, dtype="int64")
data_var_.append(l) data_var_.append(l)
self._sparse_data_var.append(l) self._sparse_data_var.append(l)
self._sparse_data_var_map[name] = l
return data_var_ return data_var_
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册