Generic method updates:
^
will now invoke tf.square()
or
tf.sqrt()
directly when appropriate|
, &
, and !
now cast
arguments to ‘bool’ dtype.print()
now shows 1d shapes without a trailing
commas.str()
method for tensors now returns only a single
compact line; str()
on a list of tensors now does something
sensible.install_tensorflow()
now install TensorFlow 2.9 by
default.
install_tensorflow()
no longer requires conda on
Windows, now works in a regular venv.
Comparing two partially-defined TensorShape
now
returns TRUE if each dimension matches. e.g.:
shape(NA, 4) == shape(NA, 4)
now returns TRUE, previously
FALSE.
Tensors with dtype ‘string’ now convert to R character vectors by
methods as.array()
and as.matrix()
.
(previously they converted to python.builtin.bytes, or an R list of
python.builtin.bytes objects)
as_tensor()
:
tf$dtypes$saturate_cast()
instead of
tf$cast()
.shape
argument now accepts a tensor.shape
provided as a tensor would raise an error.tf.SparseTensor
objects now inherit from
"tensorflow.tensor"
.
Updated default Tensorflow version installed by
install_tensorflow()
to 2.8.
as_tensor()
gains a shape
argument, can
be used to fill or reshape tensors. Scalars can be recycled to a tensor
of arbitrary shape
, otherwise supplied objects are reshaped
using row-major (C-style) semantics.
install_tensorflow()
now provides experimental
support for Arm Macs, with the following restrictions:
install_tensorflow()
default conda_python_version
changes from 3.7 to NULL.
tf.TensorShape()
’s gain format()
and
print()
S3 methods.
[
method for slicing tensors now accepts
NA
as a synonym for a missing or NULL
spec.
For example x[NA:3]
is now valid, equivalent to
x[:3]
in Python.
Default Tensorflow version installed by
install_tensorflow()
updated to 2.7
Breaking changes:
shape()
now returns a tf.TensorShape()
object (Previously an R-list of NULL
s or integers).[
method for tf.TensorShape()
objects also
now returns a tf.TensorShape()
. Use [[
,
as.numeric
, as.integer
, and/or
as.list
to convert to R objects.length()
method for tensorflow.tensor
now
returns NA_integer_
for tensors with not fully defined
shapes. (previously a zero length integer vector).dim()
method for tensorflow.tensor
now
returns an R integer vector with NA
for dimensions that are
undefined. (previously an R list with NULL
for undefined
dimension)New S3 generics for tf.TensorShape()
’s:
c
, length
, [<-
,
[[<-
, merge
, ==
,
!=
, as_tensor()
, as.list
,
as.integer
, as.numeric
,
as.double
, py_str
(joining previous generics
[
and [[
). See ?shape
for
extended examples.
Ops S3 generics for tensorflow.tensor
s that take two
arguments now automatically cast a supplied non-tensor to the dtype of
the supplied tensor that triggered the S3 dispatch. Casting is done via
as_tensor()
. e.g., this now works:
as_tensor(5L) - 2 # now returns tf.Tensor(3, shape=(), dtype=int32)
previously it would raise an error:
TypeError: `x` and `y` must have the same dtype, got tf.int32 != tf.float32
Generics that now do autocasting: +, -, *, /, %/%, %%, ^, &, |, ==,
!=, <, <=, >, >=
install_tensorflow()
: new argument with default
pip_ignore_installed = TRUE
. This ensures that all
Tensorflow dependencies like Numpy are installed by pip rather than
conda.
A message with the Tensorflow version is now shown when the python module is loaded, e.g: “Loaded Tensorflow version 2.6.0”
Updated default Tensorflow version to 2.6.
Changed default in tf_function()
to
autograph=TRUE
.
Added S3 generic as_tensor()
.
tfautograph added to Imports
jsonlite removed from Imports, tfestimators removed from Suggests
Refactored install_tensorflow()
.
install_tensorflow(version="2.4")
will install
"2.4.2"
. Previously it would install “2.4.0”)Removed “Config/reticulate” declaration from DESCRIPTION.
RETICULATE_AUTOCONFIGURE=FALSE
environment
variable when using non-default tensorflow installations (e.g.,
‘tensorflow-cpu’) no longer required.install_tensorflow()
for
automatic installation.Refactored automated tests to closer match the default installation procedure and compute environment of most user.
Expanded CI test coverage to include R devel, oldrel and 3.6.
Fixed an issue where extra packages with version constraints like
install_tensorflow(extra_packages = "Pillow<8.3")
were
not quoted properly.
Fixed an issue where valid tensor-like objects supplied to
log(x, base)
, cospi()
, tanpi()
,
and sinpi()
would raise an error.
tf_function()
(e.g., jit_compile
)expm1
S3 generic.tfe_enable_eager_execution
is deprecated. Eager mode
has been the default since TF version 2.0.tf_config()
on unsuccessful
installation.use_session_with_seed
(#428)set_random_seed
function that makes more
sense for TensorFlow >= 2.0 (#442)Bugfix with all_dims
(#398)
Indexing for TensorShape & py_to_r
conversion
(#379, #388)
Upgraded default installed version to 2.0.0.
Tensorboard log directory path fixes (#360).
Allow for v1
and v2
compat
(#358).
install_tensorflow
now does not installs
tfprobability
, tfhub
and other related
packages.
Upgraded default installed version to 1.14.0
Refactored the install_tensorflow
code delegating to
reticulate
(#333, #341): We completely delegate to
installation to reticulate::py_install
, the main difference
is that now the default environment name to install is
r-reticulate
and not r-tensorflow
.
added option to silence TF CPP info output
tf_gpu_configured
function to check if GPU was
correctly