MCPcopy Create free account
hub / github.com/pytorch/executorch / get_example_inputs

Method get_example_inputs

examples/models/toy_model/model.py:128–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 return self
127
128 def get_example_inputs(self):
129 # Input shape: (batch, num_heads, seq_len, head_dim)
130 batch_size = 2
131 num_heads = 8
132 seq_len = 128
133 head_dim = 64
134 query = torch.randn(
135 batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16
136 )
137 key = torch.randn(
138 batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16
139 )
140 value = torch.randn(
141 batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16
142 )
143 return (query, key, value)

Callers 2

Calls

no outgoing calls

Tested by 2