| {".class": "MypyFile", "_fullname": "torch.nn.modules.transformer", "future_import_flags": [], "is_partial_stub_package": false, "is_stub": false, "names": {".class": "SymbolTable", "Any": {".class": "SymbolTableNode", "cross_ref": "typing.Any", "kind": "Gdef"}, "Callable": {".class": "SymbolTableNode", "cross_ref": "typing.Callable", "kind": "Gdef"}, "Dropout": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.dropout.Dropout", "kind": "Gdef"}, "F": {".class": "SymbolTableNode", "cross_ref": "torch.nn.functional", "kind": "Gdef"}, "LayerNorm": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.normalization.LayerNorm", "kind": "Gdef"}, "Linear": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.linear.Linear", "kind": "Gdef"}, "Module": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.module.Module", "kind": "Gdef"}, "ModuleList": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.container.ModuleList", "kind": "Gdef"}, "MultiheadAttention": {".class": "SymbolTableNode", "cross_ref": "torch.nn.modules.activation.MultiheadAttention", "kind": "Gdef"}, "Optional": {".class": "SymbolTableNode", "cross_ref": "typing.Optional", "kind": "Gdef"}, "Tensor": {".class": "SymbolTableNode", "cross_ref": "torch._tensor.Tensor", "kind": "Gdef"}, "Transformer": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["torch.nn.modules.module.Module"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "torch.nn.modules.transformer.Transformer", "name": "Transformer", "type_vars": []}, "deletable_attributes": [], "flags": [], "fullname": "torch.nn.modules.transformer.Transformer", "has_param_spec_type": false, "metaclass_type": null, "metadata": {}, "module_name": "torch.nn.modules.transformer", "mro": ["torch.nn.modules.transformer.Transformer", "torch.nn.modules.module.Module", "builtins.object"], "names": {".class": "SymbolTable", "__init__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "num_encoder_layers", "num_decoder_layers", "dim_feedforward", "dropout", "activation", "custom_encoder", "custom_decoder", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.__init__", "name": "__init__", "type": {".class": "CallableType", "arg_kinds": [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "num_encoder_layers", "num_decoder_layers", "dim_feedforward", "dropout", "activation", "custom_encoder", "custom_decoder", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "arg_types": ["torch.nn.modules.transformer.Transformer", "builtins.int", "builtins.int", "builtins.int", "builtins.int", "builtins.int", "builtins.float", {".class": "UnionType", "items": ["builtins.str", {".class": "CallableType", "arg_kinds": [0], "arg_names": [null], "arg_types": ["torch._tensor.Tensor"], "bound_args": [], "def_extras": {}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": null, "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}]}, {".class": "UnionType", "items": [{".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 2}, {".class": "NoneType"}]}, {".class": "UnionType", "items": [{".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 2}, {".class": "NoneType"}]}, "builtins.float", "builtins.bool", "builtins.bool", {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}, {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "__init__ of Transformer", "ret_type": {".class": "NoneType"}, "type_guard": null, "variables": []}}}, "_reset_parameters": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["self"], "flags": [], "fullname": "torch.nn.modules.transformer.Transformer._reset_parameters", "name": "_reset_parameters", "type": null}}, "batch_first": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.batch_first", "name": "batch_first", "type": "builtins.bool"}}, "d_model": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.d_model", "name": "d_model", "type": "builtins.int"}}, "decoder": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.decoder", "name": "decoder", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 2}}}, "encoder": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.encoder", "name": "encoder", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 2}}}, "forward": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "src", "tgt", "src_mask", "tgt_mask", "memory_mask", "src_key_padding_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.forward", "name": "forward", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "src", "tgt", "src_mask", "tgt_mask", "memory_mask", "src_key_padding_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.Transformer", "torch._tensor.Tensor", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "forward of Transformer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "generate_square_subsequent_mask": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Decorator", "func": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["sz"], "flags": ["is_static", "is_decorated"], "fullname": "torch.nn.modules.transformer.Transformer.generate_square_subsequent_mask", "name": "generate_square_subsequent_mask", "type": {".class": "CallableType", "arg_kinds": [0], "arg_names": ["sz"], "arg_types": ["builtins.int"], "bound_args": [], "def_extras": {"first_arg": null}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "generate_square_subsequent_mask of Transformer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}, "is_overload": false, "var": {".class": "Var", "flags": ["is_initialized_in_class", "is_staticmethod", "is_ready"], "fullname": null, "name": "generate_square_subsequent_mask", "type": {".class": "CallableType", "arg_kinds": [0], "arg_names": ["sz"], "arg_types": ["builtins.int"], "bound_args": [], "def_extras": {"first_arg": null}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "generate_square_subsequent_mask of Transformer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}}, "nhead": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.Transformer.nhead", "name": "nhead", "type": "builtins.int"}}}, "slots": null, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "TransformerDecoder": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["torch.nn.modules.module.Module"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "torch.nn.modules.transformer.TransformerDecoder", "name": "TransformerDecoder", "type_vars": []}, "deletable_attributes": [], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder", "has_param_spec_type": false, "metaclass_type": null, "metadata": {}, "module_name": "torch.nn.modules.transformer", "mro": ["torch.nn.modules.transformer.TransformerDecoder", "torch.nn.modules.module.Module", "builtins.object"], "names": {".class": "SymbolTable", "__constants__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Var", "flags": ["is_initialized_in_class", "has_explicit_value"], "fullname": "torch.nn.modules.transformer.TransformerDecoder.__constants__", "name": "__constants__", "type": {".class": "Instance", "args": ["builtins.str"], "type_ref": "builtins.list"}}}, "__init__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1], "arg_names": ["self", "decoder_layer", "num_layers", "norm"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder.__init__", "name": "__init__", "type": null}}, "forward": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1, 1, 1, 1], "arg_names": ["self", "tgt", "memory", "tgt_mask", "memory_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder.forward", "name": "forward", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 1, 1, 1, 1], "arg_names": ["self", "tgt", "memory", "tgt_mask", "memory_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoder", "torch._tensor.Tensor", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "forward of TransformerDecoder", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "layers": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder.layers", "name": "layers", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "norm": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder.norm", "name": "norm", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "num_layers": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoder.num_layers", "name": "num_layers", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}}, "slots": null, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "TransformerDecoderLayer": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["torch.nn.modules.module.Module"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer", "name": "TransformerDecoderLayer", "type_vars": []}, "deletable_attributes": [], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer", "has_param_spec_type": false, "metaclass_type": null, "metadata": {}, "module_name": "torch.nn.modules.transformer", "mro": ["torch.nn.modules.transformer.TransformerDecoderLayer", "torch.nn.modules.module.Module", "builtins.object"], "names": {".class": "SymbolTable", "__constants__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Var", "flags": ["is_initialized_in_class", "has_explicit_value"], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.__constants__", "name": "__constants__", "type": {".class": "Instance", "args": ["builtins.str"], "type_ref": "builtins.list"}}}, "__init__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "dim_feedforward", "dropout", "activation", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.__init__", "name": "__init__", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "dim_feedforward", "dropout", "activation", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoderLayer", "builtins.int", "builtins.int", "builtins.int", "builtins.float", {".class": "UnionType", "items": ["builtins.str", {".class": "CallableType", "arg_kinds": [0], "arg_names": [null], "arg_types": ["torch._tensor.Tensor"], "bound_args": [], "def_extras": {}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": null, "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}]}, "builtins.float", "builtins.bool", "builtins.bool", {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}, {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "__init__ of TransformerDecoderLayer", "ret_type": {".class": "NoneType"}, "type_guard": null, "variables": []}}}, "__setstate__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["self", "state"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.__setstate__", "name": "__setstate__", "type": null}}, "_ff_block": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["self", "x"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer._ff_block", "name": "_ff_block", "type": {".class": "CallableType", "arg_kinds": [0, 0], "arg_names": ["self", "x"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoderLayer", "torch._tensor.Tensor"], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "_ff_block of TransformerDecoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "_mha_block": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 0, 0], "arg_names": ["self", "x", "mem", "attn_mask", "key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer._mha_block", "name": "_mha_block", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 0, 0], "arg_names": ["self", "x", "mem", "attn_mask", "key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoderLayer", "torch._tensor.Tensor", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "_mha_block of TransformerDecoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "_sa_block": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 0], "arg_names": ["self", "x", "attn_mask", "key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer._sa_block", "name": "_sa_block", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 0], "arg_names": ["self", "x", "attn_mask", "key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoderLayer", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "_sa_block of TransformerDecoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "activation": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.activation", "name": "activation", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "dropout": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.dropout", "name": "dropout", "type": "torch.nn.modules.dropout.Dropout"}}, "dropout1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.dropout1", "name": "dropout1", "type": "torch.nn.modules.dropout.Dropout"}}, "dropout2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.dropout2", "name": "dropout2", "type": "torch.nn.modules.dropout.Dropout"}}, "dropout3": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.dropout3", "name": "dropout3", "type": "torch.nn.modules.dropout.Dropout"}}, "forward": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1, 1, 1, 1], "arg_names": ["self", "tgt", "memory", "tgt_mask", "memory_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.forward", "name": "forward", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 1, 1, 1, 1], "arg_names": ["self", "tgt", "memory", "tgt_mask", "memory_mask", "tgt_key_padding_mask", "memory_key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerDecoderLayer", "torch._tensor.Tensor", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "forward of TransformerDecoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "linear1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.linear1", "name": "linear1", "type": "torch.nn.modules.linear.Linear"}}, "linear2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.linear2", "name": "linear2", "type": "torch.nn.modules.linear.Linear"}}, "multihead_attn": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.multihead_attn", "name": "multihead_attn", "type": "torch.nn.modules.activation.MultiheadAttention"}}, "norm1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.norm1", "name": "norm1", "type": "torch.nn.modules.normalization.LayerNorm"}}, "norm2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.norm2", "name": "norm2", "type": "torch.nn.modules.normalization.LayerNorm"}}, "norm3": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.norm3", "name": "norm3", "type": "torch.nn.modules.normalization.LayerNorm"}}, "norm_first": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.norm_first", "name": "norm_first", "type": "builtins.bool"}}, "self_attn": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerDecoderLayer.self_attn", "name": "self_attn", "type": "torch.nn.modules.activation.MultiheadAttention"}}}, "slots": null, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "TransformerEncoder": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["torch.nn.modules.module.Module"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "torch.nn.modules.transformer.TransformerEncoder", "name": "TransformerEncoder", "type_vars": []}, "deletable_attributes": [], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder", "has_param_spec_type": false, "metaclass_type": null, "metadata": {}, "module_name": "torch.nn.modules.transformer", "mro": ["torch.nn.modules.transformer.TransformerEncoder", "torch.nn.modules.module.Module", "builtins.object"], "names": {".class": "SymbolTable", "__constants__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Var", "flags": ["is_initialized_in_class", "has_explicit_value"], "fullname": "torch.nn.modules.transformer.TransformerEncoder.__constants__", "name": "__constants__", "type": {".class": "Instance", "args": ["builtins.str"], "type_ref": "builtins.list"}}}, "__init__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1], "arg_names": ["self", "encoder_layer", "num_layers", "norm"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder.__init__", "name": "__init__", "type": null}}, "forward": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 1, 1], "arg_names": ["self", "src", "mask", "src_key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder.forward", "name": "forward", "type": {".class": "CallableType", "arg_kinds": [0, 0, 1, 1], "arg_names": ["self", "src", "mask", "src_key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerEncoder", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "forward of TransformerEncoder", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "layers": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder.layers", "name": "layers", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "norm": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder.norm", "name": "norm", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "num_layers": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoder.num_layers", "name": "num_layers", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}}, "slots": null, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "TransformerEncoderLayer": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "TypeInfo", "_promote": null, "abstract_attributes": [], "bases": ["torch.nn.modules.module.Module"], "declared_metaclass": null, "defn": {".class": "ClassDef", "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer", "name": "TransformerEncoderLayer", "type_vars": []}, "deletable_attributes": [], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer", "has_param_spec_type": false, "metaclass_type": null, "metadata": {}, "module_name": "torch.nn.modules.transformer", "mro": ["torch.nn.modules.transformer.TransformerEncoderLayer", "torch.nn.modules.module.Module", "builtins.object"], "names": {".class": "SymbolTable", "__constants__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "Var", "flags": ["is_initialized_in_class", "has_explicit_value"], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.__constants__", "name": "__constants__", "type": {".class": "Instance", "args": ["builtins.str"], "type_ref": "builtins.list"}}}, "__init__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "dim_feedforward", "dropout", "activation", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.__init__", "name": "__init__", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], "arg_names": ["self", "d_model", "nhead", "dim_feedforward", "dropout", "activation", "layer_norm_eps", "batch_first", "norm_first", "device", "dtype"], "arg_types": ["torch.nn.modules.transformer.TransformerEncoderLayer", "builtins.int", "builtins.int", "builtins.int", "builtins.float", {".class": "UnionType", "items": ["builtins.str", {".class": "CallableType", "arg_kinds": [0], "arg_names": [null], "arg_types": ["torch._tensor.Tensor"], "bound_args": [], "def_extras": {}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": null, "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}]}, "builtins.float", "builtins.bool", "builtins.bool", {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}, {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "__init__ of TransformerEncoderLayer", "ret_type": {".class": "NoneType"}, "type_guard": null, "variables": []}}}, "__setstate__": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["self", "state"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.__setstate__", "name": "__setstate__", "type": null}}, "_ff_block": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["self", "x"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer._ff_block", "name": "_ff_block", "type": {".class": "CallableType", "arg_kinds": [0, 0], "arg_names": ["self", "x"], "arg_types": ["torch.nn.modules.transformer.TransformerEncoderLayer", "torch._tensor.Tensor"], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "_ff_block of TransformerEncoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "_sa_block": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 0, 0], "arg_names": ["self", "x", "attn_mask", "key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer._sa_block", "name": "_sa_block", "type": {".class": "CallableType", "arg_kinds": [0, 0, 0, 0], "arg_names": ["self", "x", "attn_mask", "key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerEncoderLayer", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "_sa_block of TransformerEncoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "activation": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.activation", "name": "activation", "type": {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 1}}}, "dropout": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.dropout", "name": "dropout", "type": "torch.nn.modules.dropout.Dropout"}}, "dropout1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.dropout1", "name": "dropout1", "type": "torch.nn.modules.dropout.Dropout"}}, "dropout2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.dropout2", "name": "dropout2", "type": "torch.nn.modules.dropout.Dropout"}}, "forward": {".class": "SymbolTableNode", "kind": "Mdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0, 1, 1], "arg_names": ["self", "src", "src_mask", "src_key_padding_mask"], "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.forward", "name": "forward", "type": {".class": "CallableType", "arg_kinds": [0, 0, 1, 1], "arg_names": ["self", "src", "src_mask", "src_key_padding_mask"], "arg_types": ["torch.nn.modules.transformer.TransformerEncoderLayer", "torch._tensor.Tensor", {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}, {".class": "UnionType", "items": ["torch._tensor.Tensor", {".class": "NoneType"}]}], "bound_args": [], "def_extras": {"first_arg": "self"}, "fallback": "builtins.function", "from_concatenate": false, "implicit": false, "is_ellipsis_args": false, "name": "forward of TransformerEncoderLayer", "ret_type": "torch._tensor.Tensor", "type_guard": null, "variables": []}}}, "linear1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.linear1", "name": "linear1", "type": "torch.nn.modules.linear.Linear"}}, "linear2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.linear2", "name": "linear2", "type": "torch.nn.modules.linear.Linear"}}, "norm1": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.norm1", "name": "norm1", "type": "torch.nn.modules.normalization.LayerNorm"}}, "norm2": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.norm2", "name": "norm2", "type": "torch.nn.modules.normalization.LayerNorm"}}, "norm_first": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.norm_first", "name": "norm_first", "type": "builtins.bool"}}, "self_attn": {".class": "SymbolTableNode", "implicit": true, "kind": "Mdef", "node": {".class": "Var", "flags": [], "fullname": "torch.nn.modules.transformer.TransformerEncoderLayer.self_attn", "name": "self_attn", "type": "torch.nn.modules.activation.MultiheadAttention"}}}, "slots": null, "tuple_type": null, "type_vars": [], "typeddict_type": null}}, "Union": {".class": "SymbolTableNode", "cross_ref": "typing.Union", "kind": "Gdef"}, "__annotations__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_ready"], "fullname": "torch.nn.modules.transformer.__annotations__", "name": "__annotations__", "type": {".class": "Instance", "args": ["builtins.str", {".class": "AnyType", "missing_import_name": null, "source_any": null, "type_of_any": 6}], "type_ref": "builtins.dict"}}}, "__doc__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_ready"], "fullname": "torch.nn.modules.transformer.__doc__", "name": "__doc__", "type": "builtins.str"}}, "__file__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_ready"], "fullname": "torch.nn.modules.transformer.__file__", "name": "__file__", "type": "builtins.str"}}, "__name__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_ready"], "fullname": "torch.nn.modules.transformer.__name__", "name": "__name__", "type": "builtins.str"}}, "__package__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": ["is_ready"], "fullname": "torch.nn.modules.transformer.__package__", "name": "__package__", "type": "builtins.str"}}, "_get_activation_fn": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "FuncDef", "arg_kinds": [0], "arg_names": ["activation"], "flags": [], "fullname": "torch.nn.modules.transformer._get_activation_fn", "name": "_get_activation_fn", "type": null}}, "_get_clones": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["module", "N"], "flags": [], "fullname": "torch.nn.modules.transformer._get_clones", "name": "_get_clones", "type": null}}, "copy": {".class": "SymbolTableNode", "cross_ref": "copy", "kind": "Gdef"}, "torch": {".class": "SymbolTableNode", "cross_ref": "torch", "kind": "Gdef"}, "xavier_uniform_": {".class": "SymbolTableNode", "cross_ref": "torch.nn.init.xavier_uniform_", "kind": "Gdef"}}, "path": "/home/patrick/hf/lib/python3.7/site-packages/torch/nn/modules/transformer.py"} |