from __future__ import annotations import torch from torch import nn from torch.nn import functional as F from . import neurocc as nc from . import neurocc_ast as ast from . import neurocc_curriculum as c from . import neurocc_graph_ssa as ssa from . import neurocc_binary as old FIELDS=5 def pack(values,lengths): """Tensor-only concatenation of predicted per-anchor byte sequences.""" b,t,w=values.shape; out=t*w+1; dev=values.device offsets=lengths.cumsum(1)-lengths j=torch.arange(w,device=dev)[None,None,:]; valid=j