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

Function padding

eagle/model/cnets.py:464–470  ·  view source on GitHub ↗
(tensor, left=True)

Source from the content-addressed store, hash-verified

462
463@torch.no_grad()
464def padding(tensor, left=True):
465 zeropadding = torch.zeros_like(tensor[:, -1:])
466 if left:
467 tensor = torch.cat((zeropadding, tensor[:, :-1]), dim=1)
468 else:
469 tensor = torch.cat((tensor[:, 1:], zeropadding), dim=1)
470 return tensor
471
472
473

Callers

nothing calls this directly

Calls 1

catMethod · 0.45

Tested by

no test coverage detected