import torch


def TemplFeaturizeFixbb(seq, conf_1d=None):
    """
    Template 1D featurizer for fixed BB examples  

    Parameters:
        
        seq (torch.tensor, required): Integer sequence 
        
        conf_1d (torch.tensor, optional): Precalcualted confidence tensor
    """
    L = seq.shape[-1]

    t1d  = torch.nn.functional.one_hot(seq, num_classes=21) # one hot sequence 

    if conf_1d is None:
        conf = torch.ones_like(seq)[...,None]
    else:
        conf = conf_1d[:,None]
    
    
    t1d = torch.cat((t1d, conf), dim=-1)

    return t1d