def METHOD_NAME(cls, args):
    # It Will be used in FastText2UnitModel model, insdead of nn.Embedding on speaker-id, we default to use x-vectors extracted ahead.
    # This is for varying the speaker information when generating units from text.
    if args.speaker_to_id is not None:
        embed_speaker = torch.nn.Embedding(
            len(args.speaker_to_id), args.speaker_embed_dim
        )
    elif args.speaker_embedding_type == "x-vector":
        # return LayerNorm(args.speaker_embed_dim)
        return lambda x: x.unsqueeze(1)
    elif args.speaker_embedding_type == "i-vector":
        # return LayerNorm(args.speaker_embed_dim)
        return lambda x: x
    else:
        embed_speaker = None
    return embed_speaker