10 Commits

Author SHA1 Message Date
6831d8e379 Support Union in TorchScript (#64234)
Summary:
This PR is created to replace https://github.com/pytorch/pytorch/pull/53180 PR stack, which has all the review discussions. Reason for needing a replacement is due to a messy Sandcastle issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/64234

Reviewed By: gmagogsfm

Differential Revision: D30656444

Pulled By: ansley

fbshipit-source-id: 77536c8bcc88162e2c72636026ca3c16891d669a
2021-09-03 06:12:24 -07:00
449828378d Serialize ClassType as its qualname
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30058

Test Plan: Imported from OSS

Differential Revision: D18584269

Pulled By: jamesr66a

fbshipit-source-id: 5f1d0142bd7cd94eecbd2ed9250a0de47639040b
2019-11-20 16:17:26 -08:00
c8c5e11fba Support variadic returns in Schema's operator<< (#23204)
Summary:
old: prim::PythonOp(...) ->
new: prim::PythonOp(...) -> ...

Pull Request resolved: https://github.com/pytorch/pytorch/pull/23204
ghstack-source-id: 87208343

Reviewed By: zrphercule

Differential Revision: D16433592

fbshipit-source-id: 36cbb329188f112e09c3b1708a8090781b830dfe
2019-07-26 10:58:00 -07:00
0e3a359a38 Align the operator<< for Argument with FunctionSchema parser (#23203)
Summary:
Align the Argument's operator<< with parser,
additional support:
1) List size
2) real default value
3) Alias information

Pull Request resolved: https://github.com/pytorch/pytorch/pull/23203
ghstack-source-id: 87118985

Reviewed By: zrphercule

Differential Revision: D16433188

fbshipit-source-id: aea5711f93feacd94d1732e2f0d61218a31a0c5c
2019-07-25 15:28:17 -07:00
722f80a07d Align String str() with the format in FunctionSchema (#23201)
Summary:
old: string
new: str

Pull Request resolved: https://github.com/pytorch/pytorch/pull/23201
ghstack-source-id: 87125580

Reviewed By: zrphercule

Differential Revision: D16432340

fbshipit-source-id: 56bc7e8efbc2276315f464958cf38704f75dd06e
2019-07-25 11:31:00 -07:00
972ec676b2 Remove lowered execution (#21674)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21674
ghimport-source-id: b8e27f0ce9b8b362daf73556ee67457fb5355062

Reviewed By: eellison

Differential Revision: D15777726

Pulled By: zdevito

fbshipit-source-id: 718ac676c9a1bcf99b856862fd29631d825645da
2019-06-16 14:29:18 -07:00
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
6b79e16d6d revert test/expect files (#12332)
Summary:
Linter added newline to the expect files in #12144 . This reverts it.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12332

Reviewed By: SsnL

Differential Revision: D10201790

Pulled By: Yangqing

fbshipit-source-id: 29f87c013c3522675a765a81a92520fbaea10057
2018-10-04 11:12:57 -07:00
38f3d1fc40 move flags to c10 (#12144)
Summary:
still influx.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12144

Reviewed By: smessmer

Differential Revision: D10140176

Pulled By: Yangqing

fbshipit-source-id: 1a313abed022039333e3925d19f8b3ef2d95306c
2018-10-04 02:09:56 -07:00
32bb4040dd Unified type annotation parsing for script frontends (#10279)
Summary:
After this, all combinations of {String frontend, Python AST Frontend}{Python 3-style type annotations, MyPy-style type comments}{Script method, Script function} should properly accept type annotations.

Possible TODOs:
- Clean up the functions marked HACK
- Clean up the Subscript tree-view to better match the Python AST versions
- Can we use this for Python functions? That's the only place annotations.get_signature() is still needed
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10279

Differential Revision: D9319726

Pulled By: jamesr66a

fbshipit-source-id: b13f7d4f066b0283d4fc1421a1abb9305c3b28fa
2018-08-14 18:13:15 -07:00