pytorch/test/expect/TestScript.test_annot_ast_mypy_method.expect
Elias Ellison 70db53661b expose fixed length list argument (#13142)
Summary:
Arguments have an optional fixed length list field which allows either a list or a single element that will be broadcast to a fixed length.

This PR exposes that as a denotable argument, mostly to cover the many instances in which this used in the standard library. It appears in the standard library with ints & floats. Since this is not really a pattern we want to promote moving forward, I did not expose this for booleans or tensors.

We could consider making the optional static length part of the list type, instead of the argument, which would make some of this code much nicer.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13142

Differential Revision: D12876047

Pulled By: eellison

fbshipit-source-id: e7359d2a878b4627fc2b9ebc090f9849ee524693
2018-11-01 10:34:52 -07:00

9 lines
461 B
Plaintext

foo(Tensor x, (Tensor, Tensor) y) -> (Tensor, Tensor)
foo(Tensor x, (Tensor, Tensor) y) -> (Tensor, Tensor)
foo(string x, (Tensor, Tensor) y) -> (string, string)
foo(int x, (Tensor, Tensor) y) -> (int, int)
foo(bool x, (Tensor, Tensor) y) -> (bool, bool)
foo(float[] x, (Tensor, Tensor) y) -> (float[], float[])
foo(int[] x, (Tensor, Tensor) y) -> (int[], int[])
foo(int[] x, (Tensor, Tensor) y) -> (int[], int[])
foo(int? x, (Tensor, Tensor) y) -> (int?, int?)