Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@zhangguanheng66
Copy link
Contributor

@zhangguanheng66 zhangguanheng66 commented Dec 23, 2020

On top of #1027

Add __setitem__ func to torchtext.experimental.vocab.Vocab. A __delitem__ func is added as well.

[RuntimeError] if the token exists, a error message is sent out and ask users to delete the existing token from vocab.

Note: for the vocab, we don't support the assignment between a single index and multiple tokens.

@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #1113 (fe5ce92) into master (9053d95) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1113      +/-   ##
==========================================
+ Coverage   79.46%   79.52%   +0.06%     
==========================================
  Files          47       47              
  Lines        3175     3185      +10     
==========================================
+ Hits         2523     2533      +10     
  Misses        652      652              
Impacted Files Coverage Δ
torchtext/experimental/vocab.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9053d95...fe5ce92. Read the comment docs.

@zhangguanheng66 zhangguanheng66 changed the title [DO NOT REVIEW] Add __setitem__ func to torchtext.experimental.vocab.Vocab Add __setitem__ func to torchtext.experimental.vocab.Vocab Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants