Skip to content

Commit

Permalink
Another attempt to fix vector doc type problem
Browse files Browse the repository at this point in the history
  • Loading branch information
markgw committed Feb 10, 2020
1 parent a0bb3d2 commit 6920956
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python/pimlico/datatypes/corpora/floats.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ class VectorDocumentType(RawDocumentType):
def reader_init(self, reader):
super(VectorDocumentType, self).reader_init(reader)
# Prepare struct for reading in the whole vector
dim = reader.datatype.metadata["dimensions"]
dim = reader.metadata["dimensions"]
self.struct = struct.Struct("<" + "d"*dim)
self.value_size = self.struct.size

def writer_init(self, writer):
super(VectorDocumentType, self).writer_init(writer)
# Prepare struct for writing out the whole vector
dim = writer.datatype.metadata["dimensions"]
dim = writer.metadata["dimensions"]
self.struct = struct.Struct("<" + "d"*dim)
self.value_size = self.struct.size

Expand Down

0 comments on commit 6920956

Please sign in to comment.