From dfa5ab08492247b51e856e7c5af0e3afe5af1f19 Mon Sep 17 00:00:00 2001 From: stuartgo Date: Tue, 9 Dec 2025 17:41:01 +0100 Subject: [PATCH] changed to array from tensor --- anansyTypes/structures/embedding.py | 8 ++++---- anansyTypes/structures/lexeme.py | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/anansyTypes/structures/embedding.py b/anansyTypes/structures/embedding.py index aeb56a3..38666d5 100644 --- a/anansyTypes/structures/embedding.py +++ b/anansyTypes/structures/embedding.py @@ -1,15 +1,15 @@ from __future__ import annotations from dataclasses import dataclass -import torch +import numpy as np @dataclass(frozen=True) class Embedding: - data: torch.Tensor + data: np.ndarray def __post_init__(self): - if not isinstance(self.data, torch.Tensor): - raise TypeError(f"data must be a torch.Tensor, got {type(self.data)}") + if not isinstance(self.data, np.ndarray): + raise TypeError(f"data must be a numpy.ndarray, got {type(self.data)}") def compare(self, other: Embedding) -> float: """ diff --git a/anansyTypes/structures/lexeme.py b/anansyTypes/structures/lexeme.py index 082ae71..2d27e8d 100644 --- a/anansyTypes/structures/lexeme.py +++ b/anansyTypes/structures/lexeme.py @@ -20,3 +20,5 @@ class Lexeme(ABC): """Embedding(s) associated with the lexeme.""" pass + +