tensorflow 2.7.0
-
Default Tensorflow version installed by
install_tensorflow()
updated to 2.7 -
Breaking changes:
shape()
now returns atf.TensorShape()
object
(Previously an R-list ofNULL
s or integers).[
method fortf.TensorShape()
objects also now returns atf.TensorShape()
.
Use[[
,as.numeric
,as.integer
, and/oras.list
to convert to R objects.length()
method fortensorflow.tensor
now returnsNA_integer_
for
tensors with not fully defined shapes. (previously a zero length integer vector).dim()
method fortensorflow.tensor
now returns an R integer vector
withNA
for dimensions that are undefined.
(previously an R list withNULL
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 viaas_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 defaultpip_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"