Skip to content

Commit 4560afa

Browse files
avikchaudhurimeta-codesync[bot]
authored andcommitted
port-model: add 7 typed port examples as eval baseline
Summary: Adds seven Tensor[]-shaped ports under fbcode/pyrefly/test/tensor_shapes/models/: mobilenetv2, mixtral_moe, wavernn, openpose, apg, finalmlp, masknet. Each was selected as the highest-scoring round from the v7 multi-round eval batch (R1 blind → R2 self-reflection → optional R3) using the verify_port.sh metric (shaped-vs-bare ratio, receipt coverage, smoke tests). They serve two purposes: 1. Reference ports demonstrating the skill's intended output across architectures (vision, MoE transformer, RNN, pose estimation, recommendation MLPs). 2. A baseline corpus future skill iterations can be evaluated against without re-burning compute on the v7 multi-round flow. Also lifts three stub additions surfaced by the mobilenetv2 port into fixtures/torch/nn/__init__.pyi: Conv2d.bias, GroupNorm.weight, GroupNorm.bias. Without these, the init-loop pattern (`for m in self.modules(): if isinstance(m, nn.Conv2d): m.bias`) fails to typecheck. Reviewed By: stroxler Differential Revision: D102635653 fbshipit-source-id: 1508cc0bffd34726a22a3706c84e792890ad91e0
1 parent 98d87b6 commit 4560afa

8 files changed

Lines changed: 2702 additions & 0 deletions

File tree

test/tensor_shapes/fixtures/torch/nn/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ class RMSNorm(Module):
312312

313313
class GroupNorm(Module):
314314
"""Applies Group Normalization"""
315+
316+
weight: Tensor
317+
bias: Tensor
318+
315319
def __init__(
316320
self,
317321
num_groups: int,
@@ -503,6 +507,7 @@ class Conv2d[InC, OutC, K, S = 1, P = 0, D = 1](Module):
503507
"""
504508

505509
weight: Tensor[OutC, InC, K, K]
510+
bias: Tensor[OutC] | None
506511

507512
def __init__(
508513
self,

0 commit comments

Comments
 (0)