Commit Graph

37 Commits

Author SHA1 Message Date
Yun Peng
bfc4d2d2e4 Update pip dependency reference from @pypi_XXX//:pkg to @pypi//XXX.
The `@pypi_<name>` references are deprecated and their repo names are
an implementation detail of how an underlying library is downloaded.
The modern, supported, way is to go through the hub (`@pypi`). This
also makes the code compatible with both workspace and bzlmod.

PiperOrigin-RevId: 812915387
2025-09-29 13:31:45 -07:00
David Dunleavy
994febe935 Add .bazel suffix to some third_party files
PiperOrigin-RevId: 734359305
2025-03-06 18:29:15 -08:00
A. Unique TensorFlower
e85860e838 use hermetic Python in Tensorflow.
See ci/official/requirements_updater/README.md for details.

PiperOrigin-RevId: 546059481
2023-07-06 12:29:19 -07:00
A. Unique TensorFlower
6d77cb5dfb Set up a new flag and test environment for the new dtype promotion semantics.
PiperOrigin-RevId: 546020104
2023-07-06 10:08:50 -07:00
A. Unique TensorFlower
7f39a389d5 ROLLBACK
use hermetic Python in Tensorflow/XLA/TSL builds. See ci/official/requirements_updater/README.md for details.

PiperOrigin-RevId: 540651045
2023-06-15 12:07:23 -07:00
A. Unique TensorFlower
66b9b9befa use hermetic Python in Tensorflow/XLA/TSL builds. See ci/official/requirements_updater/README.md for details.
PiperOrigin-RevId: 540478942
2023-06-14 23:08:30 -07:00
Fiona Lang
949a7ebbef Relocate Tensor to tensor.py.
Updates references inside `ops.py` to point to the
new library. Adds aliases for the symbols formerly
defined in `ops.py` to allow transparent forwarding
outside of `ops`.

PiperOrigin-RevId: 535702892
2023-05-26 13:46:20 -07:00
Russell Power
3e326c8dba Split out SymbolicTensor type from base Tensor.
This creates an explicit class for symbolic tensors.

The Tensor base class remains shared between Eager and Graph tensors, but
becomes a pure interface type.

PiperOrigin-RevId: 529748789
2023-05-05 10:21:21 -07:00
Jiawei Xia
2ff2d3c692 Add flatten method to Tensors when NumPy behavior is turned on, just like np.ndarray.flatten
PiperOrigin-RevId: 519863499
2023-03-27 16:45:18 -07:00
Russell Power
da7bd3c069 Create custom Python objects for Graph, Operation, and Tensor.
Migrate basic operations onto these types. The default Pybind wrapping approach
is not compatible with subclassed objects, and given the reference cycles in
the TF Graph/Tensor/Op usage, runs into memory management issues. Instead we
follow the approach taken by JAX pjit and create a custom Python object, but
continue to use the Pybind mechanisms to simplify the class creation and
function calling mechanisms.

PiperOrigin-RevId: 518944554
2023-03-23 13:21:00 -07:00
Tristen Allen
a8ef06a88b Subclass core types in Tensor and EagerTensor.
`Tensor` now subclasses the type `core.Symbol`;
`EagerTensor` subclasses the type `core.Value`.

These are pre-existing types which are not used
in other locations and are currently not exported.

`EagerTensor` subclasses `Symbol` by way of subclassing
`ops.Tensor`; care should be taken when performing
`isinstance` checks on `Value`, e.g.:

```python
if isinstance(core.Symbol) and not isinstance(core.Value):
  ...
```

PiperOrigin-RevId: 508754289
2023-02-10 14:36:56 -08:00
Jiawei Xia
3e2be1f8f1 Add support to ndim in Graph-mode Tensors as well
PiperOrigin-RevId: 508455173
2023-02-09 13:10:48 -08:00
wcn
d8a85e6638 Internal-only change to BUILD files
PiperOrigin-RevId: 489204515
2022-11-17 07:20:54 -08:00
TensorFlower Gardener
203c095d35 Merge pull request #50527 from NeilGirdhar:master
PiperOrigin-RevId: 386478512
Change-Id: I014627ba79c465473fbf9d590f4952bfd2055f31
2021-07-23 10:20:40 -07:00
Jun Xu
7b25a4a4f0 Add methods mean, max, and min to TF Numpy ndarray using standalone TF Numpy functions mean, amax, and amin, respectively.
An optional argument, out, is added to the signature of functions mean, amax, and amin, to support the interoperability of Numpy and TF Numpy.  Its setting is unsupported.

PiperOrigin-RevId: 369731725
Change-Id: Ib80e3740de69441d55cfdd4ffbc8862c6df342e0
2021-04-21 14:15:37 -07:00
Peng Wang
edd7e6ff07 Exports tf.experimental.numpy.enable_numpy_behavior, and unbreaks tf-numpy guide.
PiperOrigin-RevId: 358529149
Change-Id: I533f9bce385480cdbd17492cf21130fab5d00328
2021-02-19 19:55:11 -08:00
Peng Wang
0b9ff2eb1a Remove ndarray wrapper from TF Numpy. We return tensors directly.
PiperOrigin-RevId: 355761429
Change-Id: I1ab012bcd831550cd2aa2a8de3d758c23bc6332a
2021-02-04 19:20:27 -08:00
A. Unique TensorFlower
985ad0276a PY2 removal cleanup
PiperOrigin-RevId: 352907145
Change-Id: I82de30d92dc9c2b53215d6d5732c67afe339c23d
2021-01-20 17:11:44 -08:00
TensorFlower Gardener
f37d0b7c28 Merge pull request #44475 from marload:np/poisson
PiperOrigin-RevId: 341121013
Change-Id: I7fc40d2c2ee328169b6655a35d2164f252f7437f
2020-11-06 14:46:24 -08:00
TensorFlower Gardener
ab5682ec1b Merge pull request #44474 from marload:np/standard_normal
PiperOrigin-RevId: 341085577
Change-Id: I1c650512644039317ca3b3c51a4ef6249f1b0068
2020-11-06 11:43:24 -08:00
marload
0feb03f60b pbtxt 2020-10-31 13:30:55 +09:00
marload
9fe80f8c5c impl 2020-10-31 13:01:26 +09: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
TensorFlower Gardener
f56f3a7391 Merge pull request #42539 from DarrenZhang01:master
PiperOrigin-RevId: 330840468
Change-Id: Iafdbf4bd8bc74f1487daf05e15ce15f5c406d6aa
2020-09-09 18:25:07 -07:00
DarrenZhang01
df04b17d6f Add the change after running bazel. 2020-09-04 19:36:32 -04:00
Akshay Modi
bc742075f8 Clip method on ndarray
PiperOrigin-RevId: 328241384
Change-Id: I6f7d3c5fd73f1c8b31c178c2b69a786a2a2d44e3
2020-08-24 17:54:59 -07:00
Peng Wang
0a80c623e8 Adds all directly-imported numpy classes to the do-not-descend map for tf.experimental.numpy, to prevent future OSS breakages.
PiperOrigin-RevId: 321692135
Change-Id: I0b55034776a09c41757d476fab019d0d9b338e66
2020-07-16 18:56:13 -07:00
Peng Wang
90da05cd1c [TF-numpy] Exports np.newaxis.
PiperOrigin-RevId: 321687455
Change-Id: I47a9f566b9a961368cfb4f076674fc0b94a6e140
2020-07-16 18:19:35 -07:00
Peng Wang
bd3b7979d2 Adds string_ and unicode_ to the do-not-descend map of tf.experimental.numpy.
PiperOrigin-RevId: 321609879
Change-Id: I175fa2cec731de275a8810b94bb19d93fc3edacc
2020-07-16 11:37:04 -07:00
Peng Wang
f09611a4b8 Exports tf-numpy symbols under tf.experimental.numpy. Golden files for tf.experimental.numpy are put under tensorflow/third_party/py/numpy/tf_numpy_api instead of the usual golden file location.
PiperOrigin-RevId: 321469615
Change-Id: I3f20ce057e16db1438c853162474fc8fd19c2e2a
2020-07-15 17:23:14 -07:00
Peng Wang
76ac3e6a5f Adds NumPy LICENSE and lists of NumPy API symbols that tf.experimental.numpy implements to tensorflow/third_party/py/numpy/
PiperOrigin-RevId: 317755065
Change-Id: I0efd21b4bf917b7f14ec30e0b5710954844de448
2020-06-22 16:55:59 -07:00
A. Unique TensorFlower
8e0d6f12ef Automated rollback of change 153736477
Change: 153825726
2017-04-21 07:48:35 -07:00
Shanqing Cai
3a39b41b97 Automated rollback of change 153709951
Change: 153736477
2017-04-20 12:05:32 -07:00
A. Unique TensorFlower
7933420df6 Adding python_configure.bzl to (partially) replace python_config.sh
Change: 153709951
2017-04-20 08:30:56 -07:00
Justine Tunney
5a4ee93120 Add missing numpy and six deps
Change: 143131671
2016-12-28 14:28:15 -08:00
Vijay Vasudevan
bf6b536bde TensorFlow: Upstream changes to git.
Change 109240606
	Fix typo
Change 109240358
	Fix bug in Concat's shape inference due to legacy scalar handling.

	The shape function was inadvertently converting outputs of unknown
	shape (rank=None) to vectors of unknown length (rank=1), due to
	inability to distinguish between legacy scalars and vectors, because
	`max(1, None)` is 1.
Change 109237152
	Remove numarray requirement in python_config.
Change 109234003
	Fix typo in elu documentation.
Change 109232946
	Python must now be configured via ./configure script
Change 109232134
	Backported fixes to the tensor comparison operators from the public Eigen repository
Change 109231761
	Test invalid inputs to softmax_cross_entropy_with_logits.
Change 109230218
	Backported fixes to the tensor comparison operators from the public Eigen repository
Change 109229915
	Correct comments in seq2seq to show the right input types for embedding models.
	(Thanks to hugman@github for bringing this up.)
Change 109229118
	Fix resize_images example in documentation and allow resize_images to run on a single image with partially-known shape.
Change 109228940
	Fix demo and node add/remove button spacing
Change 109227909
	Include Elu in the NN docs.
Change 109227059
	Adds variable_op_scope and makes variable_scope always add a name_scope.

	This creates an op scope for variables that makes it easy to create independent
	operations with a default name by making that name unique for the current scope
	and it allows explicit names that are not made unique.

Change 109224492
	Streamline yuv -> rgb conversion to be done in one pass in native code.

	The entire process now takes ~2ms (including the ByteBuffer.get() calls), down from 10+ ms when the arrays were being interleaved in Java prior to conversion.

	Also abstracting common yuv->rgb color conversion into helper method.
Change 109224389
	Add ability to move nodes in and out of auxiliary nodes in graph.
Change 109217177
	Update generated Op docs.
Change 109215030
	Implementation of the ELU activation function: http://arxiv.org/abs/1511.07289
Change 109209848
	When GPUBFCAllocator runs out of memory, also log a summary
	of chunks in use by size.
Change 109206569
	Switched to the public version of the Eigen::sign method since it supports complex numbers.
Change 109199813
	Modify tensorflow.SequenceExample to support multiple-length sequences.

Base CL: 109241553
2015-12-02 15:04:40 -08:00