Merge pull request #14928 from sneaxiy/fix_gc

Fix gc bug
for_weibo
Zeng Jinle 6 years ago committed by GitHub
commit 16c244bc3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -100,7 +100,7 @@ static void DeleteUnusedTensors(
continue;
}
auto* var = scope.FindVar(name);
if (var != nullptr) {
if (var == nullptr) {
continue;
}

@ -39,6 +39,7 @@ def train(network, use_cuda, use_parallel_executor, batch_size=32, pass_num=2):
label = fluid.layers.data(name="label", shape=[1], dtype="int64")
cost = network(data, label, len(word_dict))
cost.persistable = True
optimizer = fluid.optimizer.Adagrad(learning_rate=0.2)
optimizer.minimize(cost)

Loading…
Cancel
Save