summaryrefslogtreecommitdiff
path: root/aten
diff options
context:
space:
mode:
authorJames Reed <jamesreed@fb.com>2019-03-18 14:06:31 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-03-18 14:11:57 -0700
commit0eb4f7aa71a1aeff0727c546210877bfcb3c4ee3 (patch)
tree19eeb7674398f62d408f333a2210acbb6ee53483 /aten
parent670f509984efce8aab0b0b5b166ff01472af6f1c (diff)
downloadpytorch-0eb4f7aa71a1aeff0727c546210877bfcb3c4ee3.tar.gz
pytorch-0eb4f7aa71a1aeff0727c546210877bfcb3c4ee3.tar.bz2
pytorch-0eb4f7aa71a1aeff0727c546210877bfcb3c4ee3.zip
Modify BeamSearch to support CharSourceEncoder (#18107)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18107 Pull Request resolved: https://github.com/pytorch/translate/pull/396 also: 1. fix issues with OptionalType not having a createWithContainedType (PyTorch diff) 2. Delete tests for ONNX full beam search export (nobody is using it and it just makes things harder. Currently ONNX doesn't support `_unwrap_optional`) Reviewed By: jmp84 Differential Revision: D14483771 fbshipit-source-id: 0e37ef1cb5a16d03a535eef808b0488b98802128
Diffstat (limited to 'aten')
-rw-r--r--aten/src/ATen/core/jit_type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/aten/src/ATen/core/jit_type.h b/aten/src/ATen/core/jit_type.h
index eaab78a64f..5cbe64e086 100644
--- a/aten/src/ATen/core/jit_type.h
+++ b/aten/src/ATen/core/jit_type.h
@@ -246,6 +246,11 @@ struct CAFFE2_API OptionalType: public SingleElementType<TypeKind::OptionalType,
return ss.str();
}
+ TypePtr createWithContained(std::vector<TypePtr> contained_types) const override {
+ AT_ASSERT(contained_types.size() == 1);
+ return create(contained_types[0]);
+ }
+
// common cast Optional[Tensor] for undefined tensor type
static OptionalTypePtr ofTensor();
private: