Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions graph_net/paddle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ def replay_tensor(info):
if "data" in info and info["data"] is not None:
return paddle.reshape(info["data"], shape).to(dtype).to(device)
elif dtype == paddle.int32 or dtype == paddle.int64:
# for some ops(binary_cross_entropy), label data can only be set 0 or 1.
return paddle.cast(
paddle.randint(low=0, high=2, shape=shape, dtype="int64"),
paddle.randint(
low=min_value, high=max_value + 1, shape=shape, dtype="int64"
),
dtype,
).to(device)
elif dtype == paddle.bool:
Expand All @@ -192,7 +193,6 @@ def replay_tensor(info):
).to(device)
else:
std = info["info"]["std"]
# return paddle.randn(shape).to(dtype).to(device) * std * 1e-3 + 1e-2
return (
paddle.uniform(shape, dtype="float32", min=min_value, max=max_value)
.to(dtype)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b30ca9883649d991bc8c4ba04da935a9b4b73a36613bcc8529ef9a0a2fb8b1d3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"framework": "paddle",
"num_devices_required": 1,
"num_nodes_required": 1
}
Loading