Skip to content

Commit 0bb45f0

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/GraphNet into squim_subjective
2 parents cbff2e6 + 7c43d38 commit 0bb45f0

File tree

637 files changed

+630142
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

637 files changed

+630142
-1
lines changed

graph_net/torch/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@
88
import argparse
99
import importlib
1010
import inspect
11+
import math
1112

1213

1314
def apply_templates(forward_code: str) -> str:
1415
tab = " "
1516
forward_code = f"\n{tab}".join(forward_code.split("\n"))
16-
return f"import torch\n\nclass GraphModule(torch.nn.Module):\n{tab}{forward_code}"
17+
imports = "import torch"
18+
if "device" in forward_code:
19+
imports += "\n\nfrom torch import device"
20+
return f"{imports}\n\nclass GraphModule(torch.nn.Module):\n{tab}{forward_code}"
1721

1822

1923
def get_limited_precision_float_str(value):
2024
if not isinstance(value, float):
2125
return value
26+
if not math.isfinite(value):
27+
return f'float("{value}")'
2228
return f"{value:.3f}"
2329

2430

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
49efabd40a93e856c10a3cf40aef7d7ad7e6f9fcfed3fc57f883ebd0e7d3f938
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"framework": "torch",
3+
"num_devices_required": 1,
4+
"num_nodes_required": 1
5+
}

samples/timm/beit3_base_patch16_224.in22k_ft_in1k/input_meta.py

Whitespace-only changes.

samples/timm/beit3_base_patch16_224.in22k_ft_in1k/input_tensor_constraints.py

Whitespace-only changes.

samples/timm/beit3_base_patch16_224.in22k_ft_in1k/model.py

Lines changed: 2206 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)