# Derived from PFN PLaMo; see docs/LICENSING.md. import enum import math import warnings from typing import Any, Dict, List, Literal, NamedTuple, Optional, Tuple, Union import torch from torch import nn from torch.nn import functional as F from transformers import GenerationMixin, PretrainedConfig, PreTrainedModel from transformers.cache_utils import DynamicCache from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast class LuxferEmbedding(nn.Embedding): def forward(self, x: torch.Tensor) -> torch.Tensor: y = super().forward(x) return y * (self.embedding_dim**0.5) # Legacy source aliases; canonical public names use Luxfer. Plamo3Embedding = LuxferEmbedding