Skip to content

Commit

Permalink
don't call py_xptr_str
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Feb 13, 2017
1 parent 0138276 commit 7c52294
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions R/generics.R
Expand Up @@ -3,21 +3,19 @@
#' @importFrom utils str
#' @export
str.tensorflow.python.framework.ops.Tensor <- function(object, ...) {
if (py_is_null_xptr(object))
if (py_is_null_xptr(object) || !py_available())
cat("<pointer: 0x0>\n")
else
py_xptr_str(object, cat(py_str(object), "\n", sep=""))
cat(py_str(object), "\n", sep="")
}

#' @export
str.tensorflow.python.ops.variables.Variable <- function(object, ...) {
if (py_is_null_xptr(object))
if (py_is_null_xptr(object) || !py_available())
cat("<pointer: 0x0>\n")
else
py_xptr_str(object,
cat("Variable(shape=", py_str(object$get_shape()), ", ",
"dtype=", object$dtype$name, ")\n", sep = "")
)
cat("Variable(shape=", py_str(object$get_shape()), ", ",
"dtype=", object$dtype$name, ")\n", sep = "")
}

#' @export
Expand Down

0 comments on commit 7c52294

Please sign in to comment.