From ea64916f0ef8d47992514003e9b76787cead6991 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 1 Apr 2019 15:12:10 -0300 Subject: [PATCH 1/5] Fix warning about generic methods for complex numbers. --- R/generics.R | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/R/generics.R b/R/generics.R index 5d4b59ba..f0fefa68 100644 --- a/R/generics.R +++ b/R/generics.R @@ -288,26 +288,26 @@ #' @export -Re.tensorflow.tensor <- function(x) { - tf$real(x) +Re.tensorflow.tensor <- function(z) { + tf$real(z) } #' @export -Im.tensorflow.tensor <- function(x) { - tf$imag(x) +Im.tensorflow.tensor <- function(z) { + tf$imag(z) } #' @export -Conj.tensorflow.tensor <- function(x) { - tf$conj(x) +Conj.tensorflow.tensor <- function(z) { + tf$conj(z) } #' @export -Arg.tensorflow.tensor <- function(x) { - tf$angle(x) +Arg.tensorflow.tensor <- function(z) { + tf$angle(z) } #' @export -Mod.tensorflow.tensor <- function(x) { - tf$abs(x) +Mod.tensorflow.tensor <- function(z) { + tf$abs(z) } From 0a2a2b18c938a231d649e84362dc710ab64781f5 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 1 Apr 2019 15:17:58 -0300 Subject: [PATCH 2/5] Update roxygen2 --- DESCRIPTION | 2 +- man/install_tensorflow.Rd | 3 +-- man/sub-.tensorflow.tensor.Rd | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 684e3b79..d6927736 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -46,4 +46,4 @@ Imports: rstudioapi (>= 0.7) Roxygen: list(markdown = TRUE) Suggests: testthat, keras, tfestimators -RoxygenNote: 6.1.0 +RoxygenNote: 6.1.1 diff --git a/man/install_tensorflow.Rd b/man/install_tensorflow.Rd index 751e0386..832fc248 100644 --- a/man/install_tensorflow.Rd +++ b/man/install_tensorflow.Rd @@ -6,8 +6,7 @@ \usage{ install_tensorflow(method = c("auto", "virtualenv", "conda", "system"), conda = "auto", version = "default", envname = "r-tensorflow", - extra_packages = c("keras", "tensorflow-hub"), - restart_session = TRUE) + extra_packages = NULL, restart_session = TRUE) } \arguments{ \item{method}{Installation method. By default, "auto" automatically finds a diff --git a/man/sub-.tensorflow.tensor.Rd b/man/sub-.tensorflow.tensor.Rd index 69675fd2..e1d80939 100644 --- a/man/sub-.tensorflow.tensor.Rd +++ b/man/sub-.tensorflow.tensor.Rd @@ -28,7 +28,7 @@ sess <- tf$Session() x <- tf$constant(1:15, shape = c(3, 5)) sess$run(x) -# by default, numerics supplied to `...` are interperted R style +# by default, numerics supplied to `...` are interpreted R style sess$run( x[,1] )# first column sess$run( x[1:2,] ) # first two rows sess$run( x[,1, drop = FALSE] ) @@ -57,7 +57,7 @@ identical( # tf$newaxis are valid sess$run( x[,, tf$newaxis] ) -# negative numbers are always interperted python style +# negative numbers are always interpreted python style # The first time a negative number is supplied to `[`, a warning is issued # about the non-standard behavior. sess$run( x[-1,] ) # last row, with a warning @@ -86,14 +86,14 @@ sess$run( x[, 0:10] ) options(tensorflow.extract.style = NULL) # slicing with tensors is valid too, but note, tensors are never -# translated and are always interperted python-style. +# translated and are always interpreted python-style. # A warning is issued the first time a tensor is passed to `[` sess$run( x[, tf$constant(0L):tf$constant(2L)] ) # just as in python, only scalar tensors are valid # https://www.tensorflow.org/api_docs/python/tf/Tensor#__getitem__ # To silence the warnings about tensors being passed as-is and negative numbers -# being interperted python-style, set +# being interpreted python-style, set options(tensorflow.extract.style = 'R') # clean up from examples From 496a7c5f2b85de33d6eca9b0080c66bc77422211 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 1 Apr 2019 15:19:19 -0300 Subject: [PATCH 3/5] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d6927736..bb3fef7f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tensorflow Type: Package Title: R Interface to 'TensorFlow' -Version: 1.10.0.9001 +Version: 1.13.1 Authors@R: c( person("JJ", "Allaire", role = c("aut", "cre"), email = "jj@rstudio.com"), person(family = "RStudio", role = c("cph", "fnd")), From 68fdd6597e31568fe8eb5e89138550ab88bb45a9 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Mon, 1 Apr 2019 23:38:34 -0300 Subject: [PATCH 4/5] Feature/appveyor (#1) Adding appveyor --- .Rbuildignore | 1 + README.md | 2 +- appveyor.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 appveyor.yml diff --git a/.Rbuildignore b/.Rbuildignore index 281eed7a..d8e4026b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -14,3 +14,4 @@ travis_install.sh run_tests.sh testenv MNIST-data +^appveyor\.yml$ diff --git a/README.md b/README.md index 1b1a42c8..31c0e6b5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## TensorFlow for R -[![Travis-CI Build Status](https://travis-ci.org/rstudio/tensorflow.svg?branch=master)](https://travis-ci.org/rstudio/tensorflow) [![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/tensorflow)](https://cran.r-project.org/package=tensorflow) +[![Travis-CI Build Status](https://travis-ci.org/rstudio/tensorflow.svg?branch=master)](https://travis-ci.org/rstudio/tensorflow) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/rstudio/tensorflow?branch=master&svg=true)](https://ci.appveyor.com/project/rstudio/tensorflow) [![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/tensorflow)](https://cran.r-project.org/package=tensorflow) [TensorFlowâ„¢](https://www.tensorflow.org) is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..eb80ae7e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,51 @@ +# DO NOT CHANGE the "init" and "install" sections below + +environment: + matrix: + - TF_VERSION: 1.13.1 + - TF_VERSION: 1.12.0 + +# Download script file from GitHub +init: + ps: | + $ErrorActionPreference = "Stop" + Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" + Import-Module '..\appveyor-tool.ps1' + +install: + ps: Bootstrap + +cache: + - C:\RLibrary + +# Adapt as necessary starting from here + +build_script: + - C:\Miniconda3-x64\Scripts\conda create -y --name r-tensorflow tensorflow=%TF_VERSION% numpy python=3.6.8 + - travis-tool.sh install_deps + +test_script: + - travis-tool.sh run_tests + +on_failure: + - 7z a failure.zip *.Rcheck\* + - appveyor PushArtifact failure.zip + +artifacts: + - path: '*.Rcheck\**\*.log' + name: Logs + + - path: '*.Rcheck\**\*.out' + name: Logs + + - path: '*.Rcheck\**\*.fail' + name: Logs + + - path: '*.Rcheck\**\*.Rout' + name: Logs + + - path: '\*_*.tar.gz' + name: Bits + + - path: '\*_*.zip' + name: Bits From 3e923c6c68ad5108713c0fb5e404ee47951f0cf9 Mon Sep 17 00:00:00 2001 From: Daniel Falbel Date: Tue, 2 Apr 2019 00:22:24 -0300 Subject: [PATCH 5/5] NEWS.md to track changes --- NEWS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 NEWS.md diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 00000000..61431b99 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,10 @@ +## Development version + + +## TensorFlow 1.13.1 (CRAN) + +- added option to silence TF CPP info output + +- `tf_gpu_configured` function to check if GPU was correctly + +