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

Method paddingtensor

eagle/train/main.py:180–185  ·  view source on GitHub ↗
(self, intensors, N)

Source from the content-addressed store, hash-verified

178class DataCollatorWithPadding:
179
180 def paddingtensor(self, intensors, N):
181 B, n, S = intensors.shape
182 # padding_tensor = torch.zeros(B, N - n, S,dtype=intensors.dtype)
183 padding_tensor = torch.zeros(B, N - n, S)
184 outtensors = torch.cat((intensors, padding_tensor), dim=1)
185 return outtensors
186
187 def paddingtensor2D(self, intensors, N):
188 B, n = intensors.shape

Callers 1

__call__Method · 0.95

Calls 1

catMethod · 0.45

Tested by

no test coverage detected