Commit Graph

128 Commits

Author SHA1 Message Date
Dmitry Volodin
5d3dbcffdb One more 2020-11-17 23:32:17 +03:00
Peng Wang
9bbe0ced15 Disable np_random_test on windows since it breaks windows nightly builds.
PiperOrigin-RevId: 342745987
Change-Id: I259778f3ffd38335ea779392801f4fbcf0648992
2020-11-16 16:32:25 -08:00
Saurabh Saxena
ec957ef376 Disable np_random_test on windows since it breaks windows nightly builds.
PiperOrigin-RevId: 341240486
Change-Id: I7ea63c2a425c7b6c9f20af875f455d75e88519ee
2020-11-07 18:53:46 -08:00
TensorFlower Gardener
f37d0b7c28 Merge pull request from marload:np/poisson
PiperOrigin-RevId: 341121013
Change-Id: I7fc40d2c2ee328169b6655a35d2164f252f7437f
2020-11-06 14:46:24 -08:00
marload
ad048df2a4 impl 2020-10-31 13:27:59 +09:00
marload
9fe80f8c5c impl 2020-10-31 13:01:26 +09:00
Dmitry Volodin
2381ee56d9 merge from master 2020-10-30 15:04:50 +03:00
TensorFlower Gardener
7000a21ee6 Merge pull request from marload:fix/npsize
PiperOrigin-RevId: 339777046
Change-Id: Idb92381d9f0429e4449bc8ad923a619b080cb1dd
2020-10-29 17:16:26 -07:00
Dmitry Volodin
8910f7db36 fix typos in python directory 2020-10-29 16:21:24 +03:00
marload
09fc26999c more effective cond 2020-10-28 22:53:24 +09:00
marload
bc2bb00b9b np.size is always returns int 2020-10-28 22:25:27 +09:00
TensorFlower Gardener
43de6900f8 Merge pull request from lc0:fixes
PiperOrigin-RevId: 339257850
Change-Id: If12604e6cd32f1bffdff13abcf21a059ccdd40d4
2020-10-27 08:56:11 -07:00
A. Unique TensorFlower
6b3e587edb Remove ndarray wrapper from TF Numpy. We return tensors directly.
PiperOrigin-RevId: 338859328
Change-Id: Ic1339fe2e3705102554de59088f79da87e340eea
2020-10-24 15:21:32 -07:00
Akshay Modi
958423c72b Remove ndarray wrapper from TF Numpy. We return tensors directly.
PiperOrigin-RevId: 338724775
Change-Id: I3913da84b43684cdd73995a3381408e430927489
2020-10-23 12:53:25 -07:00
Kibeom Kim
0c67638ac2 Remove deprecated tfrt_enabled test target flag.
PiperOrigin-RevId: 338530097
Change-Id: I0bd2ad366210330ece06f99a4fdb16de395ece05
2020-10-22 12:55:06 -07:00
Peng Wang
60cf96348b Adds text-generation colab to numpy_ops/g3doc.
PiperOrigin-RevId: 338386800
Change-Id: If36411ce86bba341ab16716f0ac95bf0cb89b0c8
2020-10-21 20:11:26 -07:00
Sergii Khomenko
91f3932e39 Minor fixes for numpy api docs 2020-10-21 15:20:44 +02:00
Peng Wang
a9152cdb1b [TF-numpy] Fixes Resnet50 and Transformer on tfnp@TPU (multi-core), and adds tests for them in trainer_lib_test. Also cleans up trainer_lib_test to remove duplicate code.
PiperOrigin-RevId: 337919525
Change-Id: I889ef3a9aca650779db82f5b49f0f8aa428f5fcf
2020-10-19 13:27:57 -07:00
Peng Wang
b57499d4ec [TF-numpy] Adds XLA test to lax_numpy_test.
PiperOrigin-RevId: 334461210
Change-Id: If865f1953149716711917ce626ba0ea85d63759f
2020-09-29 14:29:31 -07:00
Akshay Modi
9442c157f2 Add saving to tf numpy distributed image classification colab
PiperOrigin-RevId: 334424722
Change-Id: Iec2ce5ce26db91f80e9366d9f5c8cea57f8833a4
2020-09-29 12:16:09 -07:00
Kibeom Kim
aab4cde23e Enable more TFRT test targets that are newly passing
PiperOrigin-RevId: 333337050
Change-Id: I53a9af35c09f9ddb9ed6dc47bedfce2b8662205b
2020-09-23 11:44:50 -07:00
Akshay Modi
42637d6dab Fix broken links in colabs
PiperOrigin-RevId: 333192867
Change-Id: Ib5670619b681080c08057c037858228b107bae33
2020-09-22 17:25:02 -07:00
Peng Wang
f58490db2b Adds index_add, index_min and index_max to tf_numpy.extensions
PiperOrigin-RevId: 331821475
Change-Id: I43d9512fe81bf046945499ad9f6977e7e7ef2f01
2020-09-15 12:20:58 -07:00
TensorFlower Gardener
f56f3a7391 Merge pull request from DarrenZhang01:master
PiperOrigin-RevId: 330840468
Change-Id: Iafdbf4bd8bc74f1487daf05e15ce15f5c406d6aa
2020-09-09 18:25:07 -07:00
DarrenZhang01
fcfe64be4c Remove the unnecessary import based on
`https://github.com/tensorflow/tensorflow/pull/42539#discussion_r485189850`.
2020-09-08 19:45:54 -04:00
DarrenZhang01
feb0a77128 Remove some unnecessary if...else... statement; Wrap the return value
with an ndarray converter.
2020-09-03 18:43:43 -04:00
DarrenZhang01
4e9c20d05d Add test case for the None shape case as pointed out in
https://github.com/tensorflow/tensorflow/pull/42539#issuecomment-686715283.
2020-09-03 17:13:47 -04:00
DarrenZhang01
c65af02229 Import sys at the original place in order to avoid unnecessary
changes.
2020-09-03 15:24:34 -04:00
DarrenZhang01
e514f7c960 1. Use tf.size to deal with None shapes;
2. Change from external import to intern import.
2020-09-03 15:20:03 -04:00
DarrenZhang01
d70b16b8a5 Revise the code to handle the graph tensors. 2020-09-01 14:23:23 -04:00
DarrenZhang01
fc5de50450 Improve the size API and revise some bugs. 2020-08-31 15:12:06 -04:00
DarrenZhang01
2adfcfc8f2 Revise the bug in the test code. 2020-08-31 14:24:38 -04:00
DarrenZhang01
1f87eacbbf Revise utils to np_utils. 2020-08-29 23:05:07 -04:00
DarrenZhang01
9a9bec8fc7 1. Add # pylint: disable=missing-docstring label beside the function;
2. Revise the name of TF NumPy and vanilla NumPy according to the
   imports.
2020-08-29 22:59:42 -04:00
DarrenZhang01
706552aa1c 1. Use np.asarray wrapper to process the input in order to be able to
deal with grapg tensors;
  2. Add the `axis` parameter into the `size` API, raise
     `NotImplementedError` when the not-None `axis` parameter is sent
     in. Add the according tests.
2020-08-29 22:49:59 -04:00
Akshay Modi
bc742075f8 Clip method on ndarray
PiperOrigin-RevId: 328241384
Change-Id: I6f7d3c5fd73f1c8b31c178c2b69a786a2a2d44e3
2020-08-24 17:54:59 -07:00
Stephan Hoyer
f55a491b83 [tf-numpy] add experimental __array_module__ method
__array_module__ is an experimental protocol for "duck array" compatibility that
for indicating how to find a "numpy compatible" module. The hope is to make it
easier to write generic code that works across a range of array libraries.

A full example, which should work equally work for TF-NumPy as for JAX, can be
found at https://github.com/google/jax/pull/4076. More examples, and motivation for
this protocol can be found at https://numpy.org/neps/nep-0037-array-module.html.

This design has not yet been finalized in NumPy, so at present it requires using
the experimental numpy_dispatch module: https://github.com/seberg/numpy-dispatch.

Unlike NumPy's __array_ufunc__ and __array_function__ protocols, __array_module__
by design has no backwards compatibility consequences. The protocol only controls
the behavior of numpy_dispatch.get_array_module() or numpy.get_array_module() --
it does not change any existing NumPy functions.

PiperOrigin-RevId: 328181308
Change-Id: I98b648a59709ed3bc295aaf97f471a1ff7ae1f05
2020-08-24 12:06:17 -07:00
Akshay Modi
10332bb887 PFor inputs should be ndarrays.
PiperOrigin-RevId: 328068227
Change-Id: Ia084d946f3a0e5d071d7e8fec4263d1da26d9671
2020-08-23 19:35:24 -07:00
DarrenZhang01
9c4d5ff8fb Revise the code format according to pylint. 2020-08-22 10:53:36 -04:00
DarrenZhang01
776227e602 Remove the print statement. 2020-08-20 20:58:37 -04:00
DarrenZhang01
3406ee7ca7 Add the size API for TensorFlow NumPy operations. 2020-08-20 20:52:04 -04:00
Peng Wang
796764acdb [TF-numpy] Adds index_update to tf_numpy/extensions, supporting NumPy indexing scheme.
PiperOrigin-RevId: 327113656
Change-Id: Iad7a914eac208e29ae48acafd0c073e9dc292b98
2020-08-17 15:43:44 -07:00
A. Unique TensorFlower
a74a993732 TF NumPy: add a Keras and Distribution Strategy example.
PiperOrigin-RevId: 326767163
Change-Id: Ie34cd781eecc72ac2a23f7e6e3b01868cb928f6c
2020-08-14 18:46:07 -07:00
A. Unique TensorFlower
7c755ba32f Tensorflow NumPy: Add a distributed image classification example.
PiperOrigin-RevId: 326566589
Change-Id: I066106a6cf8508bc07a0a3141b79f85e9995adc8
2020-08-13 18:32:54 -07:00
Yash Katariya
7ac0792bf1 Use the github link for limitations guide.
PiperOrigin-RevId: 326497847
Change-Id: I850b29cb1d09f4379ecfc9e9b46e08c7d136e68b
2020-08-13 12:30:45 -07:00
Peng Wang
73ded7cd0e [TF-numpy] Makes sure that data is copied to current device in copy and array(copy=True). Also tests that it doesn't when copy=False.
PiperOrigin-RevId: 326359881
Change-Id: Icd65a73377ddba6eb26588cd540fb23952f69b5f
2020-08-12 18:57:16 -07:00
Akshay Modi
fcba9e4c22 Remove keras sequential warning for tf numpy ndarray input
PiperOrigin-RevId: 326276141
Change-Id: I684b86aae09e26a343b125eb2092adc7c581fd3f
2020-08-12 11:49:21 -07:00
Akshay Modi
4ef3bf9474 Return None, not ndarray wrapping a None from tape gradient
PiperOrigin-RevId: 325926529
Change-Id: Ic0326b07b9d8d396c48aa2c16d5c5e3f8889c434
2020-08-10 18:03:06 -07:00
A. Unique TensorFlower
d10c814ce1 TF NumPy: point to guide from API documentation.
PiperOrigin-RevId: 325911592
Change-Id: I64f9c34badb5b5484be4527a86df218bf910a79f
2020-08-10 16:40:24 -07:00
Peng Wang
00426cb403 [TF-numpy] Adds a validator for numpy doc links, and fixes broken links.
PiperOrigin-RevId: 324294777
Change-Id: If8fbf6a73dc05c09f0aa3240817f4b554d0cfc9e
2020-07-31 15:30:21 -07:00