-
Notifications
You must be signed in to change notification settings - Fork 27.5k
[test] Add error_inputs for nn.Embedding module #174179
Copy link
Copy link
Closed
Labels
actionablebot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage botenhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: nnRelated to torch.nnRelated to torch.nnmodule: testsIssues related to tests (not the torch.testing module)Issues related to tests (not the torch.testing module)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
actionablebot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage botenhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixmodule: nnRelated to torch.nnRelated to torch.nnmodule: testsIssues related to tests (not the torch.testing module)Issues related to tests (not the torch.testing module)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Summary
Add
module_error_inputs_funcfortorch.nn.Embeddingincommon_modules.pyto enable regression testing for error messages.Motivation
Currently,
torch.nn.Embeddingdoes not havemodule_error_inputs_funcdefined incommon_modules.py. This means error message regressions are not tested. Adding error inputs will:Error Conditions to Test
Out of range indices: Index exceeds
num_embeddingsIndexError: index out of range in selfFloat indices: Float tensor passed instead of integer indices
RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, IntNegative num_embeddings: Constructor called with negative dimension
RuntimeError: Trying to create tensor with negative dimensionImplementation
Add
module_error_inputs_torch_nn_Embeddingfunction and wire it to theModuleInfoentry.cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki