981 Commits

Author SHA1 Message Date
Matthew Johnson
3f638d3a40 make JaxTuple not subclass tuple, add docstrings 2019-05-01 19:32:48 -07:00
Matthew Johnson
85755820bb add defvjp functions for custom VJPs
c.f. #116, which won't be closed until we add documentation
2019-04-23 17:47:28 -07:00
Matthew Johnson
d7096a42c5
make jacrev work w/ complex inputs, update errors (#610)
* make jacrev work w/ complex inputs, update errors

* fix up complex handling in jacfwd and jacrev
2019-04-13 13:22:45 -07:00
Matthew Johnson
18671fa027 add error checks so that #603 isn't silent fail 2019-04-12 12:01:19 -07:00
Matthew Johnson
6de4b57396 improve kwargs test 2019-04-11 08:07:32 -07:00
Matthew Johnson
de2a5f725d add warning, fix typo in kwargs test and bug 2019-04-11 06:58:09 -07:00
Matthew Johnson
9c2e1c35b1 prevent jit from treating keyword args as static
fixes #523
2019-04-10 22:09:14 -07:00
Matthew Johnson
87143d8e0a add some simple tests for jarrett jvps 2019-03-23 15:11:21 -07:00
Peter Hawkins
3a456a3e73 Make assertAllClose check shapes for exact equality.
Currently assertAllClose delegates to np.is_allclose, which has broadcasting semantics.

Fix some newly failing test cases.
2019-03-14 21:59:31 -04:00
Peter Hawkins
288281d203 Relax test tolerance on grad_and_aux test. 2019-03-08 14:14:50 -05:00
Matthew Johnson
04081a4faa improve a test for grad-and-aux 2019-03-07 14:49:29 -08:00
Matthew Johnson
caa2ed1a40 fix grad-and-aux handling of constant aux data 2019-03-07 14:48:05 -08:00
Matthew Johnson
e35d5f62b2 add support for returning aux data from grad
fixes #366
2019-03-07 14:08:02 -08:00
Matthew Johnson
7701feb66c revise large device constant test 2019-02-25 13:49:40 -08:00
Matthew Johnson
a37703552f add test for device constant compile options bug 2019-02-25 13:48:01 -08:00
Matthew Johnson
121e74f5cc fix import in api_test.py 2019-02-22 07:56:13 -08:00
Matthew Johnson
a36812da30 add context manager for disabling jit 2019-02-06 19:44:12 -08:00
Matthew Johnson
b95669eb79 enable value-and-grad api test 2019-01-22 15:34:09 -08:00
cclauss
f6d9a33a86
Undefined name: 'value_and_grad' in ./tests/api_test.py
[flake8](http://flake8.pycqa.org) testing of https://github.com/google/jax on Python 3.7.1

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./tests/api_test.py:54:12: F821 undefined name 'value_and_grad'
    assert value_and_grad(f)(1.0, 1.0, 1.0, flag=True) == (y, 1.0)
           ^
./tests/api_test.py:55:12: F821 undefined name 'value_and_grad'
    assert value_and_grad(f, argnums=1)(1.0, 1.0, 1.0, flag=True) == (y, 2.0)
           ^
./tests/api_test.py:56:12: F821 undefined name 'value_and_grad'
    assert value_and_grad(f, argnums=(2, 0))(1.0, 1.0, 1.0, flag=True) == (y, (3.0, 1.0))
           ^
3     F821 undefined name 'value_and_grad'
3
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2019-01-22 23:51:37 +01:00
Matthew Johnson
ca27f0a2b2 add jacobian / hessian pytree tests (fixes #173) 2019-01-07 08:54:14 -08:00
Matthew Johnson
0f7c7c4eab generalize jacfwd and jacrev to handle pytrees 2019-01-06 12:49:41 -08:00
Matthew Johnson
565c95582d add simple value_and_grad test 2018-12-20 10:17:42 -08:00
Matthew Johnson
88bb264e07 fix exception check for python3 2018-12-18 09:58:42 -08:00
Matthew Johnson
bdc9e92f94 remove full_p to improve power:weight 2018-12-18 09:16:59 -08:00
Matthew Johnson
d3ec0b23c5 fix miscellaneous bugs, incl. complex abs grad 2018-12-12 12:03:57 -05:00
Matthew Johnson
89349e5e6d fix transpose issue in jacfwd and jacrev 2018-12-11 16:24:20 -08:00
Dougal Maclaurin
1627827ac6 Fixed a couple of bugs 2018-12-06 21:47:47 -05:00
Dougal Maclaurin
2df36f7510 Made a shim to handle configuration without having absl parse command-line flags.
PiperOrigin-RevId: 223391288
2018-11-29 13:44:54 -08:00
Matthew Johnson
3b3490f406 source sync
PiperOrigin-RevId: 222483357
2018-11-21 20:32:33 -08:00
Peter Hawkins
e180f08113 source sync
PiperOrigin-RevId: 222451919
2018-11-21 20:22:51 -08:00
Matthew Johnson
489dd1c81a move jax tests and examples to repo root 2018-11-18 15:15:47 -08:00