Commit Graph

13 Commits

Author SHA1 Message Date
Igor Sugak
4a17693d19 [CODEMOD][caffe2] replace uses of np.float with np.float64 (#112675)
Differential Revision: D50752096

Pull Request resolved: https://github.com/pytorch/pytorch/pull/112675
Approved by: https://github.com/Skylion007
2023-11-03 03:00:51 +00:00
Igor Sugak
93e5065ba0 [CODEMOD][caffe2] replace numpy.bool with bool (#111432)
Test Plan:
numpy.bool is long deprecated and removed starting numpy-1.20.0 [1]. This replaces all references with equivalent `bool` type using the following oneliner:
```
rg -l 'np\.bool' caffe2 | grep '\.py$' | xargs perl -pi -e 's,\bnp\.bool\b,bool,'
```
1. https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Differential Revision: D50372711

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111432
Approved by: https://github.com/Skylion007
2023-10-18 18:56:40 +00: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
Abhijith Reddy
371cf109a3 Increase static tolerance for negative feature ids
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/20671

Reviewed By: Wakeupbuddy

Differential Revision: D15401078

fbshipit-source-id: a946b1df6fae2851d60fadf32e57feb44ba95f38
2019-05-20 19:09:22 -07:00
Orion Reblitz-Richardson
1d5780d42c Remove Apache headers from source.
* LICENSE file contains details, so removing from individual source files.
2018-03-27 13:10:18 -07:00
Mohammad Husain
77ae903650 Skip negative indices
Summary: A single negative index can crash the job today.  We want to skip a few of them but not a lot.  If we skip too many then we will force the job to crash.

Reviewed By: kennyhorror

Differential Revision: D6003461

fbshipit-source-id: 7881ed6c2cfa78c7bda90c7aa01e81ca00fd08a6
2017-10-09 16:09:50 -07:00
Yangqing Jia
8286ce1e3a Re-license to Apache
Summary: Closes https://github.com/caffe2/caffe2/pull/1260

Differential Revision: D5906739

Pulled By: Yangqing

fbshipit-source-id: e482ba9ba60b5337d9165f28f7ec68d4518a0902
2017-09-28 16:22:00 -07:00
Andrey Malevich
2d9728d594 Add more enforces to SparseToDenseMask operator.
Summary:
It looks like this operator is missing some enforces that it should have (since
it's working on the user inputs). This diff is added enforces to ids to be in a
valid range.

Reviewed By: dzhulgakov

Differential Revision: D5488336

fbshipit-source-id: e045c3b71b92e443edd23c95aa75d144877f1334
2017-09-02 02:16:24 -07:00
Thomas Dudziak
3ccbf23132 String-related fixes for Python 3
Summary: This diff is one step towards enabling python 3 build by making it be more diligent in its handling of strings.

Reviewed By: salexspb

Differential Revision: D4893083

fbshipit-source-id: 28b8adf3280e8d1f0a7dc9b0fee5ad53f2fada57
2017-05-26 16:04:32 -07:00
Szymon Piechowicz
5ced84856a Caffe2: SparseToDenseMask: return key presence
Summary: Caffe2: SparseToDenseMask: return key presence

Reviewed By: matbd

Differential Revision: D5066863

fbshipit-source-id: 4f4dd141f6661829535cb77ff47cc0c230dce5d6
2017-05-16 20:22:03 -07:00
Andrey Malevich
301ab97e41 Fix few more operators to handle empty batches correctly.
Summary:
If we go to prod some of the sparse features might be empty or for some reason
batch might be empty. It's a good idea to be sure that we can run empty
batches.

Reviewed By: dzhulgakov

Differential Revision: D4197297

fbshipit-source-id: 1a154ebf625d1a39fd15354a154cf100f525ae9a
2016-11-29 15:18:37 -08:00
Yangqing Jia
05512d1e10 sync 2016-08-10 11:02:15 -07:00
Yangqing Jia
bcea409c82 sync 2016-07-28 15:06:43 -07:00