Document Vectors.resize() and update v2 incompatibilities (resolves #1514)

This commit is contained in:
ines 2017-11-08 17:11:11 +01:00
parent c0a7a32bf8
commit 97a5892347
2 changed files with 36 additions and 0 deletions

View File

@ -188,6 +188,38 @@ p
+cell int
+cell The row the vector was added to.
+h(2, "resize") Vectors.resize
+tag method
p
| Resize the underlying vectors array. If #[code inplace=True], the memory
| is reallocated. This may cause other references to the data to become
| invalid, so only use #[code inplace=True] if you're sure that's what you
| want. If the number of vectors is reduced, keys mapped to rows that have
| been deleted are removed. These removed items are returned as a list of
| #[code (key, row)] tuples.
+aside-code("Example").
removed = nlp.vocab.vectors.resize((10000, 300))
+table(["Name", "Type", "Description"])
+row
+cell #[code shape]
+cell tuple
+cell
| A #[code (rows, dims)] tuple describing the number of rows and
| dimensions.
+row
+cell #[code inplace]
+cell bool
+cell Reallocate the memory.
+row("foot")
+cell returns
+cell list
+cell The removed items as a list of #[code (key, row)] tuples.
+h(2, "keys") Vectors.keys
+tag method

View File

@ -45,6 +45,10 @@ p
+cell #[code Language.create_make_doc]
+cell #[+api("language#attributes") #[code Language.tokenizer]]
+row
+cell #[code Vocab.resize_vectors]
+cell #[+api("vectors#resize") #[code Vectors.resize]]
+row
+cell
| #[code Vocab.load]