Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dy2St] Remove internal API to_variable #61952

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove usage in test_se_resnet
  • Loading branch information
SigureMo committed Feb 23, 2024
commit 933b5bed7a6d5f86dd9767f645a3b71a92da7d80
5 changes: 2 additions & 3 deletions test/dygraph_to_static/test_se_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import paddle
from paddle import base
from paddle.base.dygraph.base import to_variable
from paddle.jit.api import to_static
from paddle.jit.translated_layer import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX
from paddle.nn import BatchNorm, Linear
Expand Down Expand Up @@ -403,8 +402,8 @@ def train(self, train_reader, to_static):
.reshape(BATCH_SIZE, 1)
)

img = to_variable(dy_x_data)
label = to_variable(y_data)
img = paddle.to_tensor(dy_x_data)
label = paddle.to_tensor(y_data)
label.stop_gradient = True

pred, avg_loss, acc_top1, acc_top5 = se_resnext(img, label)
Expand Down