Closed Zeldax64 closed 9 months ago
Thank you for submitting this feature request. This seems like a useful feature so I am working on adding it (hopefully later today). The reason it currently uses the default dtype is to prevent counter overflows when the dtype of the VSATensor is torch.int8
for example.
I've been using this library for a while to deploy HDC models with torchscript and one of my requirements is to carefully choose the underlying torch operations used. I noticed that
dot_similarity
is always executed usingtorch.get_default_dtype()
, which is always float. I managed to solve my issue in a fork by allowing the user to choose the dtype used indot_similarity
of MAP vectors. This change impacts the processor instructions executed when running the models and also their accuracy.I've been thinking about merging such changes back to the library but they require API changes. For instance, the
cosine_similarity
would also be changed since it relies ondot_similarity
.