MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / DynamicShapeTestLayer

Class DynamicShapeTestLayer

tests/unit/runtime/pipe/test_pipe.py:202–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202class DynamicShapeTestLayer(nn.Module):
203
204 def __init__(self, hidden_size):
205 super().__init__()
206 self.fc = nn.Linear(hidden_size, hidden_size)
207 self.shapes = set()
208
209 def forward(self, x):
210 self.shapes.add(x.shape)
211 y = self.fc(x)
212 return y
213
214
215class DynamicShapeTestModel(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

__init__Method · 0.68