MCPcopy Create free account
hub / github.com/SafeAILab/EAGLE / paddingtensor

Method paddingtensor

eagle/train/main_deepspeed.py:171–176  ·  view source on GitHub ↗
(self, intensors, N)

Source from the content-addressed store, hash-verified

169class DataCollatorWithPadding:
170
171 def paddingtensor(self, intensors, N):
172 B, n, S = intensors.shape
173 # padding_tensor = torch.zeros(B, N - n, S,dtype=intensors.dtype)
174 padding_tensor = torch.zeros(B, N - n, S)
175 outtensors = torch.cat((intensors, padding_tensor), dim=1)
176 return outtensors
177
178 def paddingtensor2D(self, intensors, N):
179 B, n = intensors.shape

Callers 1

__call__Method · 0.95

Calls 1

catMethod · 0.45

Tested by

no test coverage detected