Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve remaining type errors on dev branch #2323

Closed
redshiftzero opened this issue Jun 30, 2019 · 1 comment
Closed

resolve remaining type errors on dev branch #2323

redshiftzero opened this issue Jun 30, 2019 · 1 comment
Assignees
Labels
Status: Stale 🍞 Been open for a while with no activity Type: Code Quality 💯 Minor tweaks or style changes Type: Improvement 📈 Minor improvements not introducing a new feature or requiring a major refactor

Comments

@redshiftzero
Copy link
Contributor

redshiftzero commented Jun 30, 2019

Describe the bug

While there are many type annotations in the codebase, when running a static type checker on the code, many issues are raised (see mypy output below). Some of these may merely be incorrect annotations (still worth fixing since one of the reasons to add static type annotations is for code clarity), however some may be legitimate bugs.

PR #2321 adds static type checking in CI and resolves the first few of the below errors. Once these existing errors are addressed, we can have CI builds fail if mypy errors are found (via removing the || echo "Type errors found, continuing build..." in the mypy call added in #2321) and add running mypy to the pre-commit hook.

Related to: #1456

To Reproduce

Steps to reproduce the behavior:

  1. pip install mypy
  2. mypy --python-version 3.6 --ignore-missing-imports syft

Expected behavior

No type issues are found

Actual behavior

Many type issues flagged by mypy:

syft/grid.py:16: error: Need type annotation for 'tag_counter'
syft/grid.py:22: error: Need type annotation for 'worker_tag_ctr'
syft/grid.py:56: error: Incompatible return value type (got "Dict[Any, Any]", expected "Tuple[Dict[Any, Any], Counter[Any]]")
syft/frameworks/torch/torch_attributes.py:36: error: Module has no attribute "functional"
syft/frameworks/torch/torch_attributes.py:37: error: Module has no attribute "nn"
syft/frameworks/torch/torch_attributes.py:111: error: Module has no attribute "Tensor"
syft/frameworks/torch/torch_attributes.py:123: error: Module has no attribute "FloatTensor"
syft/frameworks/torch/torch_attributes.py:124: error: Module has no attribute "DoubleTensor"
syft/frameworks/torch/torch_attributes.py:125: error: Module has no attribute "HalfTensor"
syft/frameworks/torch/torch_attributes.py:126: error: Module has no attribute "ByteTensor"
syft/frameworks/torch/torch_attributes.py:127: error: Module has no attribute "CharTensor"
syft/frameworks/torch/torch_attributes.py:128: error: Module has no attribute "ShortTensor"
syft/frameworks/torch/torch_attributes.py:129: error: Module has no attribute "IntTensor"
syft/frameworks/torch/torch_attributes.py:130: error: Module has no attribute "LongTensor"
syft/frameworks/torch/torch_attributes.py:131: error: Module has no attribute "nn"
syft/frameworks/torch/torch_attributes.py:154: error: Need type annotation for 'inplace_methods' (hint: "inplace_methods: Dict[<type>, <type>] = ...")
syft/frameworks/torch/torch_attributes.py:209: error: "TorchAttributes" has no attribute "torch_exclude"
syft/frameworks/torch/tensors/interpreters/build_gradients.py:51: error: Need type annotation for 'grad_fn_map' (hint: "grad_fn_map: Dict[<type>, <type>] = ...")
syft/frameworks/torch/federated/dataset.py:172: error: "Type[Dataset[Any]]" has no attribute "federate"
syft/frameworks/torch/federated/dataset.py:173: error: "Type[BaseDataset]" has no attribute "federate"
syft/frameworks/torch/federated/dataloader.py:11: error: Module has no attribute "HalfTensor"
syft/exceptions.py:173: error: "str" has no attribute "decode"; maybe "encode"?
syft/exceptions.py:174: error: Incompatible types in assignment (expression has type "object", variable has type "Dict[Any, Any]")
syft/exceptions.py:178: error: Module has no attribute "exceptions"
syft/exceptions.py:179: error: Module has no attribute "exceptions"
syft/exceptions.py:216: error: "str" has no attribute "decode"; maybe "encode"?
syft/exceptions.py:217: error: Incompatible types in assignment (expression has type "object", variable has type "Dict[Any, Any]")
syft/exceptions.py:221: error: Module has no attribute "exceptions"
syft/exceptions.py:222: error: Module has no attribute "exceptions"
syft/frameworks/torch/tensors/interpreters/abstract.py:215: error: Incompatible types in assignment (expression has type "Tensor", variable has type "AbstractTensor")
syft/frameworks/torch/tensors/interpreters/abstract.py:239: error: "Tensor" has no attribute "child"
syft/frameworks/torch/tensors/interpreters/abstract.py:240: error: "Tensor" has no attribute "is_wrapper"
syft/frameworks/torch/tensors/interpreters/abstract.py:241: error: "Tensor" has no attribute "child"
syft/frameworks/torch/tensors/interpreters/abstract.py:241: error: "AbstractTensor" has no attribute "parent"
syft/frameworks/torch/pointers/object_pointer.py:65: error: Argument "id" to "__init__" of "AbstractObject" has incompatible type "Union[str, int, None]"; expected "Optional[int]"
syft/frameworks/torch/pointers/object_pointer.py:139: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "get_obj"
syft/frameworks/torch/pointers/object_pointer.py:139: error: Item "None" of "Optional[AbstractWorker]" has no attribute "get_obj"
syft/frameworks/torch/pointers/object_pointer.py:144: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "request_obj"
syft/frameworks/torch/pointers/object_pointer.py:144: error: Item "None" of "Optional[AbstractWorker]" has no attribute "request_obj"
syft/frameworks/torch/pointers/object_pointer.py:148: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "de_register_obj"
syft/frameworks/torch/pointers/object_pointer.py:148: error: Item "None" of "Optional[AbstractWorker]" has no attribute "de_register_obj"
syft/frameworks/torch/pointers/callable_pointer.py:75: error: Invalid type comment or annotation
syft/frameworks/torch/pointers/callable_pointer.py:76: error: Invalid type comment or annotation
syft/frameworks/torch/crypto/spdz.py:26: error: "AbstractWorker" has no attribute "generate_triple"
syft/frameworks/torch/crypto/spdz.py:37: error: "Tensor" has no attribute "send"
syft/frameworks/torch/crypto/spdz.py:38: error: "Tensor" has no attribute "send"
syft/workers/websocket_server.py:68: error: Need type annotation for 'broadcast_queue'
syft/workers/websocket_server.py:87: error: Cannot determine type of 'broadcast_queue'
syft/workers/websocket_server.py:101: error: Cannot determine type of 'broadcast_queue'
syft/workers/websocket_server.py:107: error: Need type annotation for 'response'
syft/workers/websocket_server.py:116: error: Invalid type "builtins.bin"
syft/workers/websocket_server.py:120: error: Module has no attribute "serialize"
syft/workers/websocket_client.py:76: error: Invalid type "builtins.bin"
syft/workers/websocket_client.py:83: error: Invalid type "builtins.bin"
syft/workers/websocket_client.py:84: error: "None" has no attribute "send"
syft/workers/websocket_client.py:85: error: "None" has no attribute "recv"
syft/workers/websocket_client.py:88: error: Invalid type "builtins.bin"
syft/workers/websocket_client.py:91: error: Need type annotation for 'response'
syft/workers/websocket_client.py:92: error: "None" has no attribute "connected"
syft/workers/websocket_client.py:93: error: Cannot determine type of 'id'
syft/workers/websocket_client.py:94: error: "None" has no attribute "shutdown"
syft/workers/websocket_client.py:100: error: Need type annotation for 'response'
syft/workers/websocket_client.py:101: error: "None" has no attribute "connected"
syft/workers/websocket_client.py:108: error: "create_message_execute_command" of "BaseWorker" gets multiple values for keyword argument "command_name"
syft/workers/websocket_client.py:108: error: "create_message_execute_command" of "BaseWorker" gets multiple values for keyword argument "command_owner"
syft/workers/websocket_client.py:108: error: Argument "command_name" to "create_message_execute_command" of "BaseWorker" has incompatible type "str"; expected "MSGTYPE"
syft/workers/websocket_client.py:113: error: Module has no attribute "serialize"
syft/workers/websocket_client.py:114: error: Need type annotation for 'response'
syft/workers/websocket_client.py:115: error: Module has no attribute "deserialize"
syft/workers/websocket_client.py:142: error: Argument "command_name" to "create_message_execute_command" of "BaseWorker" has incompatible type "str"; expected "MSGTYPE"
syft/workers/websocket_client.py:150: error: Module has no attribute "serialize"
syft/workers/websocket_client.py:159: error: Module has no attribute "serialize"
syft/workers/websocket_client.py:160: error: Need type annotation for 'response'
syft/workers/websocket_client.py:163: error: Module has no attribute "deserialize"
syft/workers/websocket_client.py:183: error: Module has no attribute "serialize"
syft/workers/websocket_client.py:184: error: Need type annotation for 'response'
syft/workers/websocket_client.py:185: error: Module has no attribute "deserialize"
syft/workers/virtual.py:9: error: Invalid type "builtins.bin"
syft/workers/virtual.py:12: error: Invalid type "builtins.bin"
syft/workers/virtual.py:17: error: "AbstractWorker" has no attribute "id"
syft/workers/virtual.py:17: error: "AbstractWorker" has no attribute "_objects"
syft/workers/virtual.py:17: error: "AbstractWorker" has no attribute "auto_add"
syft/workers/virtual.py:24: error: Module has no attribute "hook"
syft/workers/virtual.py:30: error: "AbstractWorker" has no attribute "_objects"
syft/workers/virtual.py:31: error: "AbstractWorker" has no attribute "_objects"
syft/workers/virtual.py:33: error: Incompatible return value type (got "VirtualWorker", expected "Tuple[Any, ...]")
syft/workers/virtual.py:37: error: "AbstractWorker" has no attribute "id"
syft/workers/virtual.py:54: error: "AbstractWorker" has no attribute "get_worker"
syft/workers/base.py:87: error: Need type annotation for 'msg_history' (hint: "msg_history: List[<type>] = ...")
syft/workers/base.py:101: error: Argument 1 to "load_data" of "BaseWorker" has incompatible type "Union[List[Any], Tuple[Any, ...], None]"; expected "List[Union[Tensor, AbstractTensor]]"
syft/workers/base.py:104: error: Need type annotation for '_known_workers' (hint: "_known_workers: Dict[<type>, <type>] = ...")
syft/workers/base.py:107: error: Item "None" of "Optional[BaseWorker]" has no attribute "_known_workers"
syft/workers/base.py:128: error: Invalid type "builtins.bin"
syft/workers/base.py:150: error: Invalid type "builtins.bin"
syft/workers/base.py:193: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "owner"
syft/workers/base.py:217: error: Incompatible types in assignment (expression has type "Tuple[int, str]", variable has type "str")
syft/workers/base.py:220: error: Module has no attribute "serialize"
syft/workers/base.py:226: error: Module has no attribute "deserialize"
syft/workers/base.py:230: error: Invalid type "builtins.bin"
syft/workers/base.py:250: error: Module has no attribute "deserialize"
syft/workers/base.py:254: error: Cannot call function of unknown type
syft/workers/base.py:257: error: Module has no attribute "serialize"
syft/workers/base.py:302: error: Incompatible types in assignment (expression has type "List[BaseWorker]", variable has type "BaseWorker")
syft/workers/base.py:304: error: Argument 1 to "len" has incompatible type "BaseWorker"; expected "Sized"
syft/workers/base.py:306: error: Argument 1 to "len" has incompatible type "BaseWorker"; expected "Sized"
syft/workers/base.py:323: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "create_pointer"
syft/workers/base.py:323: error: Item "AbstractTensor" of "Union[Tensor, AbstractTensor]" has no attribute "create_pointer"
syft/workers/base.py:326: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "id"
syft/workers/base.py:339: error: Missing return statement
syft/workers/base.py:360: error: "None" has no attribute "is_inplace_method"
syft/workers/base.py:362: error: Return value expected
syft/workers/base.py:378: error: "None" has no attribute "command_guard"
syft/workers/base.py:385: error: "BaseWorker" not callable
syft/workers/base.py:422: error: Incompatible types in assignment (expression has type "List[int]", variable has type "Optional[str]")
syft/workers/base.py:424: error: Incompatible types in assignment (expression has type "Tuple[str, Optional[str]]", variable has type "str")
syft/workers/base.py:434: error: Item "None" of "Optional[str]" has no attribute "__iter__" (not iterable)
syft/workers/base.py:443: error: Argument 1 to "len" has incompatible type "Optional[str]"; expected "Sized"
syft/workers/base.py:444: error: Incompatible types in assignment (expression has type "PointerTensor", variable has type "List[PointerTensor]")
syft/workers/base.py:446: error: Incompatible types in assignment (expression has type "object", variable has type "List[PointerTensor]")
syft/workers/base.py:461: error: "object" has no attribute "child"
syft/workers/base.py:462: error: "object" has no attribute "child"
syft/workers/base.py:474: error: "object" has no attribute "allowed_to_get"
syft/workers/base.py:506: error: Argument 2 to "send_msg" of "BaseWorker" has incompatible type "object"; expected "str"
syft/workers/base.py:519: error: Argument 2 to "send_msg" of "BaseWorker" has incompatible type "Union[str, int]"; expected "str"
syft/workers/base.py:583: error: Incompatible return value type (got "BaseWorker", expected "Union[str, int]")
syft/workers/base.py:701: error: Argument 2 to "send_msg" of "BaseWorker" has incompatible type "PointerTensor"; expected "str"
syft/workers/base.py:701: error: Argument "location" to "send_msg" of "BaseWorker" has incompatible type "Optional[BaseWorker]"; expected "BaseWorker"
syft/workers/base.py:719: error: Name 'sy.hook.torch.Size' is not defined
syft/workers/base.py:730: error: Argument 2 to "send_msg" of "BaseWorker" has incompatible type "PointerTensor"; expected "str"
syft/workers/base.py:730: error: Argument "location" to "send_msg" of "BaseWorker" has incompatible type "Optional[BaseWorker]"; expected "BaseWorker"
syft/workers/base.py:731: error: Module has no attribute "hook"
syft/workers/base.py:733: error: Name 'Plan' is not defined
syft/workers/base.py:778: error: "Tensor" has no attribute "tags"
syft/workers/base.py:779: error: "Tensor" has no attribute "tags"
syft/workers/base.py:782: error: "Tensor" has no attribute "description"
syft/workers/base.py:783: error: "Tensor" has no attribute "description"
syft/workers/base.py:811: error: Argument 1 to "search" of "BaseWorker" has incompatible type "*Tuple[str]"; expected "List[str]"
syft/generic/object_storage.py:32: error: "object" has no attribute "id"
syft/generic/object_storage.py:33: error: Argument 1 to "set_obj" of "ObjectStorage" has incompatible type "object"; expected "Union[Tensor, AbstractTensor]"
syft/generic/object_storage.py:47: error: "object" has no attribute "id"
syft/generic/object_storage.py:49: error: "object" has no attribute "_owner"
syft/generic/object_storage.py:97: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/precision.py:36: error: Argument 1 to "__init__" of "AbstractTensor" has incompatible type "Optional[Set[Any]]"; expected "Optional[int]"
syft/frameworks/torch/tensors/interpreters/precision.py:36: error: Argument 2 to "__init__" of "AbstractTensor" has incompatible type "Optional[str]"; expected "Optional[AbstractWorker]"
syft/frameworks/torch/tensors/interpreters/precision.py:123: error: Signatures of "__iadd__" and "__add__" are incompatible
syft/frameworks/torch/tensors/interpreters/precision.py:156: error: Signatures of "__isub__" and "__sub__" are incompatible
syft/frameworks/torch/tensors/interpreters/precision.py:258: error: Invalid signature "def (self: Any, _self: Any, other: Any) -> Any"
syft/frameworks/torch/tensors/interpreters/precision.py:263: error: Invalid signature "def (self: Any, _self: Any, other: Any) -> Any"
syft/frameworks/torch/tensors/interpreters/precision.py:268: error: Invalid signature "def (self: Any, _self: Any, other: Any) -> Any"
syft/frameworks/torch/tensors/interpreters/precision.py:273: error: Invalid signature "def (self: Any, _self: Any, other: Any) -> Any"
syft/frameworks/torch/tensors/interpreters/precision.py:561: error: Argument "tags" to "FixedPrecisionTensor" has incompatible type "object"; expected "Optional[Set[Any]]"
syft/frameworks/torch/tensors/interpreters/precision.py:561: error: Argument "description" to "FixedPrecisionTensor" has incompatible type "object"; expected "Optional[str]"
syft/frameworks/torch/tensors/interpreters/native.py:69: error: Signature of "tags" incompatible with supertype "AbstractObject"
syft/frameworks/torch/tensors/interpreters/native.py:88: error: Signature of "description" incompatible with supertype "AbstractObject"
syft/frameworks/torch/tensors/interpreters/native.py:125: error: "TorchTensor" has no attribute "native___str__"
syft/frameworks/torch/tensors/interpreters/native.py:134: error: "TorchTensor" has no attribute "native___repr__"
syft/frameworks/torch/tensors/interpreters/native.py:156: error: Signature of "id" incompatible with supertype "AbstractObject"
syft/frameworks/torch/tensors/interpreters/native.py:291: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "send"
syft/frameworks/torch/tensors/interpreters/native.py:291: error: Item "None" of "Optional[AbstractWorker]" has no attribute "send"
syft/frameworks/torch/tensors/interpreters/native.py:300: error: Cannot determine type of 'ptr'
syft/frameworks/torch/tensors/interpreters/native.py:301: error: Cannot determine type of 'ptr'
syft/frameworks/torch/tensors/interpreters/native.py:313: error: "TorchTensor" has no attribute "set_"
syft/frameworks/torch/tensors/interpreters/native.py:314: error: Property "data" defined in "TorchTensor" is read-only
syft/frameworks/torch/tensors/interpreters/native.py:321: error: "Parameter" has no attribute "data"
syft/frameworks/torch/tensors/interpreters/native.py:322: error: Incompatible types in assignment (expression has type "Parameter", variable has type "TorchTensor")
syft/frameworks/torch/tensors/interpreters/native.py:325: error: "TorchTensor" has no attribute "set_"
syft/frameworks/torch/tensors/interpreters/native.py:331: error: "TorchTensor" has no attribute "requires_grad"
syft/frameworks/torch/tensors/interpreters/native.py:339: error: Cannot determine type of 'grad'
syft/frameworks/torch/tensors/interpreters/native.py:347: error: "TorchTensor" has no attribute "backup_grad"
syft/frameworks/torch/tensors/interpreters/native.py:353: error: "TorchTensor" has no attribute "clone"
syft/frameworks/torch/tensors/interpreters/native.py:355: error: Incompatible types in assignment (expression has type "Tensor", variable has type "TorchTensor")
syft/frameworks/torch/tensors/interpreters/native.py:375: error: Invalid type comment or annotation
syft/frameworks/torch/tensors/interpreters/native.py:378: error: Invalid type comment or annotation
syft/frameworks/torch/tensors/interpreters/native.py:435: error: Incompatible types in assignment (expression has type "Optional[AbstractWorker]", variable has type "Optional[BaseWorker]")
syft/frameworks/torch/tensors/interpreters/native.py:438: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/native.py:438: error: Item "None" of "Optional[AbstractWorker]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/native.py:440: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "get_worker"
syft/frameworks/torch/tensors/interpreters/native.py:440: error: Item "None" of "Optional[AbstractWorker]" has no attribute "get_worker"
syft/frameworks/torch/tensors/interpreters/native.py:441: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "get_worker"
syft/frameworks/torch/tensors/interpreters/native.py:441: error: Item "None" of "Optional[AbstractWorker]" has no attribute "get_worker"
syft/frameworks/torch/tensors/interpreters/native.py:447: error: Item "None" of "Optional[BaseWorker]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/native.py:447: error: Item "AbstractWorker" of "Optional[AbstractWorker]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/native.py:447: error: Item "None" of "Optional[AbstractWorker]" has no attribute "id"
syft/frameworks/torch/tensors/interpreters/native.py:470: error: "TorchTensor" has no attribute "requires_grad"
syft/frameworks/torch/tensors/interpreters/native.py:471: error: Incompatible types in assignment (expression has type "AbstractTensor", variable has type "PointerTensor")
syft/frameworks/torch/tensors/interpreters/native.py:541: error: "TorchTensor" has no attribute "set_"
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:31: error: Argument 1 to "__init__" of "AbstractTensor" has incompatible type "Optional[List[str]]"; expected "Optional[int]"
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:31: error: Argument 2 to "__init__" of "AbstractTensor" has incompatible type "Optional[str]"; expected "Optional[AbstractWorker]"
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:36: error: Incompatible types in assignment (expression has type "Union[str, int, None]", variable has type "int")
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:43: error: "AbstractTensor" has no attribute "location"
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:100: error: Incompatible return value type (got "Union[Tensor, int]", expected "Tensor")
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:102: error: Incompatible return value type (got "List[Any]", expected "Tensor")
syft/frameworks/torch/tensors/interpreters/multi_pointer.py:225: error: Argument "owner" to "MultiPointerTensor" has incompatible type "AbstractWorker"; expected "Optional[BaseWorker]"
syft/frameworks/torch/tensors/interpreters/large_precision.py:102: error: Signatures of "__iadd__" and "__add__" are incompatible
syft/frameworks/torch/tensors/interpreters/large_precision.py:117: error: Signatures of "__isub__" and "__sub__" are incompatible
syft/frameworks/torch/tensors/interpreters/large_precision.py:133: error: Signatures of "__imul__" and "__mul__" are incompatible
syft/frameworks/torch/tensors/interpreters/additive_shared.py:56: error: Module has no attribute "hook"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:264: error: Item "LongTensor" of "Union[LongTensor, IntTensor]" has no attribute "share"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:264: error: Item "IntTensor" of "Union[LongTensor, IntTensor]" has no attribute "share"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:270: error: Too many arguments for "Tensor"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:270: error: "Tensor" has no attribute "share"; maybe "shape"?
syft/frameworks/torch/tensors/interpreters/additive_shared.py:305: error: Item "LongTensor" of "Union[LongTensor, IntTensor]" has no attribute "share"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:305: error: Item "IntTensor" of "Union[LongTensor, IntTensor]" has no attribute "share"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:311: error: Too many arguments for "Tensor"
syft/frameworks/torch/tensors/interpreters/additive_shared.py:311: error: "Tensor" has no attribute "share"; maybe "shape"?
syft/frameworks/torch/tensors/interpreters/additive_shared.py:419: error: Cannot determine type of '__truediv__'
syft/frameworks/torch/tensors/interpreters/additive_shared.py:419: error: Signatures of "__itruediv__" and "__truediv__" are incompatible
syft/frameworks/torch/tensors/interpreters/additive_shared.py:832: error: "AbstractWorker" has no attribute "get_worker"
syft/frameworks/torch/pointers/pointer_tensor.py:86: error: Argument "location" to "__init__" of "ObjectPointer" has incompatible type "Optional[AbstractWorker]"; expected "Optional[BaseWorker]"
syft/frameworks/torch/pointers/pointer_tensor.py:86: error: Argument "owner" to "__init__" of "ObjectPointer" has incompatible type "Optional[AbstractWorker]"; expected "Optional[BaseWorker]"
syft/frameworks/torch/pointers/pointer_tensor.py:169: error: Argument 1 to "len" has incompatible type "Optional[Size]"; expected "Sized"
syft/frameworks/torch/pointers/pointer_tensor.py:213: error: Item "None" of "Optional[BaseWorker]" has no attribute "id"
syft/frameworks/torch/pointers/pointer_tensor.py:251: error: "AbstractWorker" has no attribute "id"
syft/frameworks/torch/pointers/pointer_tensor.py:252: error: "AbstractWorker" has no attribute "get_obj"
syft/frameworks/torch/pointers/pointer_tensor.py:276: error: "None" has no attribute "hook"
syft/frameworks/torch/pointers/object_wrapper.py:104: error: Argument "id" to "ObjectWrapper" has incompatible type "str"; expected "int"
syft/federated/train_config.py:55: error: Module has no attribute "hook"
syft/federated/train_config.py:101: error: Invalid type "weakref"
syft/federated/train_config.py:183: error: Argument "model" to "TrainConfig" has incompatible type "None"; expected "ScriptModule"
syft/federated/train_config.py:183: error: Argument "loss_fn" to "TrainConfig" has incompatible type "None"; expected "ScriptModule"
syft/federated/train_config.py:183: error: Argument "optimizer" to "TrainConfig" has incompatible type "object"; expected "str"
syft/federated/train_config.py:183: error: Argument "optimizer_args" to "TrainConfig" has incompatible type "object"; expected "Dict[Any, Any]"
syft/federated/plan.py:104: error: Invalid type "builtins.callable"
syft/federated/plan.py:119: error: Need type annotation for 'plan' (hint: "plan: List[<type>] = ...")
syft/federated/plan.py:127: error: Need type annotation for 'locations' (hint: "locations: List[<type>] = ...")
syft/federated/plan.py:128: error: Need type annotation for 'ptr_plans' (hint: "ptr_plans: Dict[<type>, <type>] = ...")
syft/federated/plan.py:166: error: Invalid type "builtins.bin"
syft/federated/plan.py:173: error: Module has no attribute "deserialize"
syft/federated/plan.py:184: error: Module has no attribute "serialize"
syft/federated/plan.py:207: error: "Tensor" has no attribute "send"
syft/federated/plan.py:212: error: callable? not callable
syft/federated/plan.py:212: error: "None" not callable
syft/federated/plan.py:224: error: Incompatible types in assignment (expression has type "BaseWorker", variable has type "None")
syft/federated/plan.py:305: error: Item "int" of "Union[str, int]" has no attribute "encode"
syft/federated/plan.py:307: error: Argument 1 to "append" of "list" has incompatible type "Tuple[Union[bytes, Any], Union[bytes, Any, str, int]]"; expected "Tuple[Union[str, int], Union[str, int]]"
syft/federated/plan.py:307: error: Item "int" of "Union[str, int]" has no attribute "encode"
syft/federated/plan.py:389: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "id"
syft/federated/plan.py:450: error: Module has no attribute "hook"
syft/federated/plan.py:456: error: Module has no attribute "hook"
syft/federated/plan.py:462: error: Module has no attribute "serialize"
syft/federated/plan.py:485: error: Incompatible types in assignment (expression has type "List[Tensor]", variable has type "Tuple[Any, ...]")
syft/federated/plan.py:486: error: Incompatible types in assignment (expression has type "List[Sequence[Union[str, int]]]", variable has type "Tuple[Any, ...]")
syft/federated/plan.py:489: error: Argument "message" to "send_command" of "BaseWorker" has incompatible type "Tuple[str, Any, Tuple[Any, ...], Dict[str, Any]]"; expected "str"
syft/federated/plan.py:489: error: Argument "return_ids" to "send_command" of "BaseWorker" has incompatible type "List[Union[str, int]]"; expected "Optional[str]"
syft/federated/plan.py:533: error: Argument 1 to "send" of "BaseWorker" has incompatible type "Plan"; expected "Union[Tensor, AbstractTensor]"
syft/federated/plan.py:559: error: Incompatible types in assignment (expression has type "str", variable has type "None")
syft/federated/plan.py:564: error: Incompatible types in assignment (expression has type "Set[<nothing>]", variable has type "None")
syft/federated/plan.py:567: error: "None" has no attribute "add"
syft/federated/plan.py:634: error: Argument "owner" to "Plan" has incompatible type "AbstractWorker"; expected "BaseWorker"
syft/federated/plan.py:634: error: Argument "readable_plan" to "Plan" has incompatible type "object"; expected "Optional[List[Any]]"
syft/federated/plan.py:643: error: Incompatible types in assignment (expression has type "object", variable has type "str")
syft/federated/plan.py:644: error: Incompatible types in assignment (expression has type "object", variable has type "None")
syft/federated/plan.py:645: error: Incompatible types in assignment (expression has type "object", variable has type "None")
syft/federated/federated_client.py:34: error: Argument 1 to "set_obj" of "ObjectStorage" has incompatible type "object"; expected "Union[Tensor, AbstractTensor]"
syft/federated/federated_client.py:38: error: Name 'th.optim.Optimizer' is not defined
syft/federated/federated_client.py:73: error: "object" has no attribute "obj"
syft/federated/federated_client.py:74: error: "object" has no attribute "obj"
syft/federated/federated_client.py:87: error: Incompatible types in assignment (expression has type "SequentialSampler", variable has type "RandomSampler")
syft/serde/native_serde.py:49: error: Too many arguments for "Collection"
syft/serde/native_serde.py:75: error: "object" has no attribute "decode"
syft/serde/native_serde.py:106: error: "object" has no attribute "decode"
syft/serde/native_serde.py:164: error: Incompatible return value type (got "List[Tuple[object, object]]", expected "Dict[Any, Any]")
syft/serde/native_serde.py:188: error: "object" has no attribute "decode"
syft/serde/native_serde.py:194: error: "object" has no attribute "decode"
syft/serde/native_serde.py:257: error: Invalid type "builtins.Ellipsis"
syft/serde/native_serde.py:261: error: Invalid type "builtins.Ellipsis"
syft/serde/native_serde.py:280: error: Incompatible return value type (got "Tuple[Optional[int], Optional[int], Optional[int]]", expected "Tuple[int, int, int]")
syft/frameworks/torch/functions.py:17: error: Incompatible return value type (got "Tensor", expected "MultiPointerTensor")
syft/frameworks/torch/functions.py:17: error: Argument "children" to "MultiPointerTensor" has incompatible type "Tuple[List[ObjectPointer], ...]"; expected "List[AbstractTensor]"
syft/serde/torch_serde.py:33: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:60: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:88: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:104: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:120: error: Need type annotation for 'tensor_bin'
syft/serde/torch_serde.py:127: error: "Tensor" has no attribute "child"
syft/serde/torch_serde.py:142: error: "Tensor" has no attribute "child"
syft/serde/torch_serde.py:147: error: "Tensor" has no attribute "tags"
syft/serde/torch_serde.py:150: error: "Tensor" has no attribute "id"
syft/serde/torch_serde.py:150: error: "Tensor" has no attribute "description"
syft/serde/torch_serde.py:178: error: "None" has no attribute "hook"
syft/serde/torch_serde.py:193: error: "Tensor" has no attribute "tags"
syft/serde/torch_serde.py:198: error: "Tensor" has no attribute "description"
syft/serde/torch_serde.py:202: error: "Tensor" has no attribute "child"
syft/serde/torch_serde.py:203: error: "Tensor" has no attribute "is_wrapper"
syft/serde/torch_serde.py:211: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:224: error: "Parameter" has no attribute "data"
syft/serde/torch_serde.py:226: error: Need type annotation for 'tensor_ser'
syft/serde/torch_serde.py:231: error: "Tensor" has no attribute "child"
syft/serde/torch_serde.py:233: error: Need type annotation for 'grad_ser'
syft/serde/torch_serde.py:237: error: "Parameter" has no attribute "id"
syft/serde/torch_serde.py:258: error: "Tensor" has no attribute "garbage_collect_data"
syft/serde/torch_serde.py:259: error: "Tensor" has no attribute "child"
syft/serde/torch_serde.py:260: error: "Tensor" has no attribute "attr"
syft/serde/torch_serde.py:262: error: Incompatible types in assignment (expression has type "None", variable has type "Tensor")
syft/serde/torch_serde.py:265: error: "Parameter" has no attribute "id"
syft/serde/torch_serde.py:274: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:298: error: Invalid type "builtins.bin"
syft/serde/torch_serde.py:327: error: Incompatible return value type (got "str", expected "Tuple[str]")
syft/serde/torch_serde.py:331: error: No overload variant of "device" matches argument type "str"
syft/serde/torch_serde.py:331: note: Possible overload variants:
syft/serde/torch_serde.py:331: note:     def device(self, device: Union[int, str]) -> device
syft/serde/torch_serde.py:331: note:     def device(self, type: str, index: int) -> device
syft/serde/torch_serde.py:341: error: Argument 1 to "BytesIO" has incompatible type "str"; expected "bytes"
syft/frameworks/torch/hook/hook_args.py:25: error: Need type annotation for 'hook_method_args_functions' (hint: "hook_method_args_functions: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook_args.py:26: error: Need type annotation for 'hook_method_response_functions' (hint: "hook_method_response_functions: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook_args.py:27: error: Need type annotation for 'get_tensor_type_functions' (hint: "get_tensor_type_functions: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook_args.py:53: error: Argument 1 to "throw" of "Generator" has incompatible type "RemoteObjectFoundError"; expected "Type[BaseException]"
syft/frameworks/torch/hook/hook_args.py:620: error: Need type annotation for 'register_response_functions' (hint: "register_response_functions: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook_args.py:708: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "owner"
syft/frameworks/torch/hook/hook_args.py:710: error: Item "Tensor" of "Union[Tensor, AbstractTensor]" has no attribute "id"
syft/frameworks/torch/hook/hook_args.py:713: error: "AbstractWorker" has no attribute "register_obj"
syft/frameworks/torch/hook/hook_args.py:734: error: Argument 2 to "build_register_response" has incompatible type "Union[List[Any], Tuple[Any, ...]]"; expected "Tuple[Any, ...]"
syft/frameworks/torch/hook/hook_args.py:738: error: No overload variant of "zip" matches argument types "object", "Tuple[Any, ...]"
syft/frameworks/torch/hook/hook_args.py:738: note: Possible overload variant:
syft/frameworks/torch/hook/hook_args.py:738: note:     def [_T1, _T2] zip(Iterable[_T1], Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]
syft/frameworks/torch/hook/hook_args.py:738: note:     <5 more non-matching overloads not shown>
syft/frameworks/torch/hook/hook.py:105: error: Incompatible types in assignment (expression has type "TorchAttributes", variable has type "None")
syft/frameworks/torch/hook/hook.py:105: error: Argument 2 to "TorchAttributes" has incompatible type "TorchHook"; expected Module
syft/frameworks/torch/hook/hook.py:120: error: Need type annotation for 'to_auto_overload' (hint: "to_auto_overload: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook.py:122: error: Need type annotation for 'args_hook_for_overloaded_attr' (hint: "args_hook_for_overloaded_attr: Dict[<type>, <type>] = ...")
syft/frameworks/torch/hook/hook.py:174: error: Incompatible types in assignment (expression has type "BaseWorker", variable has type "None")
syft/frameworks/torch/hook/hook.py:175: error: Module has no attribute "hook"
syft/frameworks/torch/hook/hook.py:735: error: "type" has no attribute "native___init__"
syft/frameworks/torch/hook/hook.py:735: error: Cannot access "__init__" directly
syft/frameworks/torch/hook/hook.py:747: error: Cannot access "__init__" directly
syft/frameworks/torch/hook/hook.py:782: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:786: error: "type" has no attribute "location"
syft/frameworks/torch/hook/hook.py:788: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:792: error: "type" has no attribute "id_at_location"
syft/frameworks/torch/hook/hook.py:794: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:794: error: Name 'id' already defined on line 794
syft/frameworks/torch/hook/hook.py:805: error: "type" has no attribute "id"
syft/frameworks/torch/hook/hook.py:807: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:807: error: Name 'owner' already defined on line 807
syft/frameworks/torch/hook/hook.py:818: error: "type" has no attribute "owner"
syft/frameworks/torch/hook/hook.py:820: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:820: error: Name 'is_wrapper' already defined on line 820
syft/frameworks/torch/hook/hook.py:831: error: "type" has no attribute "is_wrapper"
syft/frameworks/torch/hook/hook.py:833: error: "type" has no attribute "native_shape"
syft/frameworks/torch/hook/hook.py:833: error: "type" has no attribute "shape"
syft/frameworks/torch/hook/hook.py:834: error: "type" has no attribute "native_data"
syft/frameworks/torch/hook/hook.py:834: error: "type" has no attribute "data"
syft/frameworks/torch/hook/hook.py:836: error: "type" has no attribute "native_grad_fn"
syft/frameworks/torch/hook/hook.py:836: error: "type" has no attribute "grad_fn"
syft/frameworks/torch/hook/hook.py:841: error: "type" has no attribute "dim"
syft/frameworks/torch/hook/hook.py:843: error: 'property' used with a non-method
syft/frameworks/torch/hook/hook.py:850: error: "type" has no attribute "grad_fn"
syft/frameworks/torch/hook/hook.py:874: error: "None" has no attribute "exclude"
syft/serde/serde.py:109: error: Incompatible types in assignment (expression has type "object", variable has type "Tuple[Any, Any]")
syft/serde/serde.py:161: error: Invalid type "builtins.bin"
syft/serde/serde.py:226: error: Invalid type "builtins.bin"
syft/serde/serde.py:246: error: "None" has no attribute "hook"
syft/serde/serde.py:319: error: Invalid type "builtins.bin"
syft/serde/serde.py:338: error: Invalid type "builtins.bin"
syft/serde/serde.py:351: error: Value of type bin? is not indexable
syft/serde/serde.py:354: error: Value of type bin? is not indexable
syft/serde/serde.py:423: error: Value of type "object" is not indexable
syft/frameworks/torch/federated/utils.py:19: error: Need type annotation for 'batches' (hint: "batches: Dict[<type>, <type>] = ...")
syft/frameworks/torch/federated/utils.py:81: error: "List[Module]" has no attribute "values"
@hereismari hereismari added Type: Improvement 📈 Minor improvements not introducing a new feature or requiring a major refactor Type: Code Quality 💯 Minor tweaks or style changes labels Jun 30, 2019
@github-actions
Copy link

This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the Status: Stale 🍞 Been open for a while with no activity label May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale 🍞 Been open for a while with no activity Type: Code Quality 💯 Minor tweaks or style changes Type: Improvement 📈 Minor improvements not introducing a new feature or requiring a major refactor
Projects
None yet
Development

No branches or pull requests

2 participants