Commit Graph

20 Commits

Author SHA1 Message Date
Richard Barnes
9945fd7253 Drop unused imports from caffe2/python (#49980)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49980

From
```
./python/libcst/libcst codemod remove_unused_imports.RemoveUnusedImportsWithGlean --no-format caffe2/
```

Test Plan: Standard sandcastle tests

Reviewed By: xush6528

Differential Revision: D25727359

fbshipit-source-id: c4f60005b10546423dc093d31d46deb418352286
2021-01-05 13:17:46 -08:00
Bugra Akyildiz
27c7158166 Remove __future__ imports for legacy Python2 supports (#45033)
Summary:
There is a module called `2to3` which you can target for future specifically to remove these, the directory of `caffe2` has the most redundant imports:

```2to3 -f future -w caffe2```

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

Reviewed By: seemethere

Differential Revision: D23808648

Pulled By: bugra

fbshipit-source-id: 38971900f0fe43ab44a9168e57f2307580d36a38
2020-09-23 17:57:02 -07:00
Duc Ngo
c7a247facf nomnigraph - support subgraph visualization (#13795)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13795

Add ability for dot string generation for a single subgraph and python bindings (which is pretty useful for model exploration in Python)
Restructure DotGenerator class a bit to make it easy to implement this feature

Reviewed By: bwasti

Differential Revision: D13010512

fbshipit-source-id: 825665438394b7e6968ab6da167b477af82a7b62
2018-11-16 08:19:20 -08:00
Duc Ngo
d7b95dda51 nomnigraph - easy - expose hasProduce(NodeRef) to python (#14075)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14075

Expose hasProduce(NodeRef) to python

Reviewed By: bwasti

Differential Revision: D13092930

fbshipit-source-id: f1ec06e73e0f5f6a16ad0cbb7d2e3e499a861d8e
2018-11-16 08:19:18 -08:00
Duc Ngo
e7f5fceb99 nomnigraph - easy - expose inducesEdges and addNode to python's NNSubgraph (#14074)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14074

expose inducesEdges and addNode to python's NNSubgraph. This make it easy to manually construct a NNSubgraph in python

Reviewed By: bwasti

Differential Revision: D13092885

fbshipit-source-id: a94ed0b318162e27e3a4b5a4954eb6d169da7405
2018-11-16 08:19:16 -08:00
Bram Wasti
8480fe0105 Fix up creation of unique data nodes
Summary:
There was a bug in the uniqueness check that only made the first run
unique

Reviewed By: duc0

Differential Revision: D13013504

fbshipit-source-id: ecf7526d0fafd7968f1301734123f93968efef46
2018-11-12 15:37:08 -08:00
Nim Arora
2cebcbae8c createUniqueDataNode
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13395

Reviewed By: bwasti

Differential Revision: D12831584

fbshipit-source-id: a349dfe7a1da0d90e62b47e1b917f358275007be
2018-10-31 11:16:38 -07:00
Dong Shi
2e19529bd1 Add HasDeviceOption [nomnigraph] (#13206)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13206

Add has device option for checking if a node has a device option set

Reviewed By: bwasti

Differential Revision: D12815365

fbshipit-source-id: 58477df93777f470cfb30cd75f02a659a7017b7c
2018-10-29 14:25:40 -07:00
Bram Wasti
48b98d2f7f Expose nn:: namespace to python (#13132)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13132

Expose more of the C++ API to python

Reviewed By: duc0

Differential Revision: D10855086

fbshipit-source-id: 98cc89bc72ef91ed1c59c1a19688e047765cf90b
2018-10-29 11:36:51 -07:00
Bram Wasti
f1e4304d19 Add operator_def property to annotation (#13094)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13094

Expose operator_def property

Reviewed By: duc0

Differential Revision: D10847125

fbshipit-source-id: 67a066555b690715e1f5f04125fd446ab197f45a
2018-10-24 23:42:35 -07:00
Dong Shi
8cb0848bdc expose delete_node (#12840)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12840

Add binding for delete_node

Reviewed By: duc0

Differential Revision: D10453555

fbshipit-source-id: cdcaca8420a9a0c61479961d907ef6bb5478a41d
2018-10-19 13:30:50 -07:00
Bram Wasti
dec9bc5f0b Expose device_option directly
Summary: as title states

Reviewed By: duc0

Differential Revision: D10442424

fbshipit-source-id: bba2dd600e1979ff018ac0e403463f992a94a6e5
2018-10-18 13:22:17 -07:00
Bram Wasti
31d8e5e71a Improve Python API with the addition of pythonic setters/getters
Summary:
Simple additions that make it vastly easier to use nomnigraph in
python

Reviewed By: duc0

Differential Revision: D10383027

fbshipit-source-id: 441a883b84d4c53cca4f9c6fcc70e58692b8f782
2018-10-16 00:57:54 -07:00
Bram Wasti
7103d0d938 Add python bindings (#12253)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12253

Adding python bindings to unblock DAI development

Reviewed By: duc0

Differential Revision: D10141621

fbshipit-source-id: efac7fb8a0cc787e1c4cc94515e673812529a997
2018-10-08 12:24:53 -07:00
Bram Wasti
d0db23e95a Add distributed annotations
Summary: Annotations for DAI

Reviewed By: duc0

Differential Revision: D9805867

fbshipit-source-id: 9ce2d9f3984817510ec8362a281f39878aad55e7
2018-09-21 19:09:59 -07:00
Bram Wasti
9eb72889b4 Add successor/predecessor functions
Summary: More functionality to prep nomnigraph for scheduler implementations

Reviewed By: duc0

Differential Revision: D9794686

fbshipit-source-id: b460859d8ff965d0049b2a696bd8d2f5c97f3f86
2018-09-18 12:27:06 -07:00
Bram Wasti
ca5def1b8f Expose annotations (#11649)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11649

Putting annotations in python interface

Reviewed By: duc0

Differential Revision: D9784750

fbshipit-source-id: d877c886ac52559ca3f009a1fd848dd1779b7d04
2018-09-17 16:39:37 -07:00
Bram Wasti
fa147abda4 Add convertToCaffe2Proto to python API
Summary: Closing the gap a bit on API, allowing users to go NetDef -> nomnigraph -> NetDef in python now

Reviewed By: duc0

Differential Revision: D9670495

fbshipit-source-id: 6497518ffc05a186deb0d657e06317980d39ddd5
2018-09-05 18:40:48 -07:00
Bram Wasti
ec6f0ed560 Additional Python Bindings
Summary:
Major change:
- Addition of pattern matching bindings

Minor change:
- OperatorDef instantiation
- Generic Graph API

Reviewed By: duc0

Differential Revision: D9546205

fbshipit-source-id: ab5274014be23a3e9e3fcf18ae1815c4f387b83c
2018-09-04 12:10:10 -07:00
Bram Wasti
cfa5dbadfc Add nomnigraph bindings
Summary: Adds basic nomnigraph python bindings for quickly playing with the graphs.

Reviewed By: duc0

Differential Revision: D9441936

fbshipit-source-id: fd70f8ea279b28c766e40f124008800acd94bddd
2018-08-28 12:40:16 -07:00