MCPcopy
hub / github.com/Ucas-HaoranWei/Vary / _shape

Method _shape

Vary-master/vary/model/llm/opt/modeling_opt.py:167–172  ·  view source on GitHub ↗
(self, tensor: torch.Tensor, seq_len: int, bsz: int)

Source from the content-addressed store, hash-verified

165 self.out_proj = nn.Linear(embed_dim, embed_dim, bias=bias)
166
167 def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
168 return (
169 tensor.view(bsz, seq_len, self.num_heads, self.head_dim)
170 .transpose(1, 2)
171 .contiguous()
172 )
173
174 def forward(
175 self,

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected