Summary:
…done once
This allow no-op build to work correctly even when BUILD_CAFFE2_OPS is on.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14982
Differential Revision: D13413960
Pulled By: zdevito
fbshipit-source-id: 6e5412a8c375af8a47c76f548cdd31cff15f3853
Summary:
This will let us install tests and other Caffe2 python code as a part of running Caffe2 tests in PyTorch.
Broken out of https://github.com/pytorch/pytorch/pull/13733/
cc pjh5 yf225
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14898
Reviewed By: pjh5
Differential Revision: D13381123
Pulled By: orionr
fbshipit-source-id: 0ec96629b0570f6cc2abb1d1d6fce084e7464dbe
Summary:
Hi guys,
I'd like to build Caffe2 with more supported options in Windows with Microsoft Visual Studios.
This is the first pull request.
Running scripts/build_windows_shared.bat is able to build Caffe2 with both CMAKE_BUILD_TYPE=Debug and CMAKE_BUILD_TYPE=Release with Visual Studio 14 2015.
CUDA is 9.0, cudnn is 7.0.5, glog, gflags and lmdb are supported on my system.
Python is 3.5, Detectron works from python interface as well.
It was even possible to debug detectron code and step into caffe2_gpu.dll with pdbs built.
What is disappointing, that c10/experimental ops don't build with this Visual Studio generator, I added special option INCLUDE_EXPERIMENTAL_C10_OPS (default ON) to deal with it in build_windows_shared.bat.
After this pull request the next step is to add Visual Studio 2017 support in the script.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13550
Reviewed By: ezyang
Differential Revision: D13042597
Pulled By: orionr
fbshipit-source-id: f313f909f599cd582a1d000eff766eef3a9fc4fc
Summary:
Let's run CI tests to see what fails given the changes that just landed in https://github.com/pytorch/pytorch/pull/10624
cc mingzhe09088 ezyang Yangqing
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10692
Reviewed By: mingzhe09088
Differential Revision: D9423617
Pulled By: orionr
fbshipit-source-id: 3bda1f118d13f8dd8e823727c93167cae747d8cf
The changes in this diff comments out unused parameters. All changes are automated using clang-tidy.
This will allow us to enable `-Wunused-parameter` as error.
#accept2ship
Summary:
Implemented syntactic sugar for the following constructs:
- `x.Gather(y)` can now be written as `x[y]`
- `x.Slice(start, end)` can now be written as `x[start:end]`
For slicing, `start` and/or `end` can be omitted iff `x` is one-dimensional (i.e. a vector). That is, `vector[start:]`, `vector[:end]` and `vector[:]` will work. Doesn't work for higher-dimensional tensors because to emit the start/end indices we need to know the rank of the tensor (since `Slice` requires one entry per dimension of the tensor).
Also added a `getProto()` function so that I could test that the generated code is as expected (i.e. that the syntactic sugar does not affect the structure of the output).
Reviewed By: zdevito
Differential Revision: D6605864
fbshipit-source-id: 786359713a13314c24be2fc07e01486c507404ef
Summary:
Adds modules:
a = Module() # create a module
a.b = 3 # set tensors in module
a.c = 4
b = my_func(a) # pass a module to a function as an argument
c = b.what + 1 # and receive a module as a return
global foo
foo.a.b # translates to Caffe2 name foo/a/b
This should help clean up beam search where many external nets are grouped
into modules.
Reviewed By: jamesr66a
Differential Revision: D6543292
fbshipit-source-id: 349eae0b1609efab4557f94650938e1fa543579d
Summary:
Uses caffe2 operator schema to check # of inputs/outputs.
Falls back to actual schema->Verify so that schema errors get
reported associated with a SourceRange.
Reviewed By: jamesr66a
Differential Revision: D6517136
fbshipit-source-id: 9be89165ea5e717c4cec1d25bbd967df86200d6c
Summary:
Adds the ability for a script function to call another and adds the extern function to register an external Caffe2 Net that can be called by the script.
Closes https://github.com/caffe2/caffe2/pull/1591
Reviewed By: jamesr66a
Differential Revision: D6515877
Pulled By: zdevito
fbshipit-source-id: b893d9e4bacd7389b550ac8a37ad7974b95de749
Summary:
* condition if
* True/False literals
* and, or, not
* 0-output expressions, like print
* _ is given a fresh name
* x.foo(...) is desugared to foo(x,...)
* +=, *=
Closes https://github.com/caffe2/caffe2/pull/1581
Reviewed By: jamesr66a
Differential Revision: D6495256
Pulled By: zdevito
fbshipit-source-id: b601d3f9e08fa544881a0c946b4feac24cb7e116
Summary:
lines such as
output_scores = best_scores_per_hypo + scores_t_squeezed
hypo_t_int64 = best_indices / 6LL
will emit the respective binary operator (e.g. `Add`, `Div`) with the `broadcast` flag set to 1
Closes https://github.com/caffe2/caffe2/pull/1577
Reviewed By: zdevito
Differential Revision: D6489991
Pulled By: jamesr66a
fbshipit-source-id: 3bef2bd43dfa18659a299cc62affd74f9a763491
Summary:
1 is an int32
1LL is an int64
1f is a float
Still need:
Parsing out numbers such as 1.0 as integer. 1.0f should work, though
Closes https://github.com/caffe2/caffe2/pull/1576
Reviewed By: zdevito
Differential Revision: D6489944
Pulled By: jamesr66a
fbshipit-source-id: 46aab9483a18a31d883c8c7e3086d3074fa5efac
Summary:
* Fix typo in negative constant handling "Negate" -> "Negative"
* Fix unpacking constant in parsing elements for a list attribute
* Parse negative signs in constants
* Switch list syntax to use square brackets in attributes
Closes https://github.com/caffe2/caffe2/pull/1572
Reviewed By: zdevito
Differential Revision: D6483286
Pulled By: jamesr66a
fbshipit-source-id: 949e8fd6a96b12efde756bac9da987da0010e153
Summary:
This is in order for Android to pass - Android support for string related functions is quite limited.
Closes https://github.com/caffe2/caffe2/pull/1571
Reviewed By: pietern
Differential Revision: D6486079
Pulled By: Yangqing
fbshipit-source-id: f0961e2dde6202bd6506f4fb8a3aea4af1670cb5
Summary: Experimental code that allows you to write C2 NetDefs directly using python-like syntax. This includes the ability to write native control-flow (if, while) and have it turn into IfOp and WhileOp
Reviewed By: jamesr66a, dzhulgakov
Differential Revision: D6123298
fbshipit-source-id: 25fc078b5769be61ac7fb3aa9a7c95bd88dccc30