Skip to content

Commit 07d3153

Browse files
authored
Merge pull request #979 from dfalbel/bugfix/text-vectorization
Calling keras_array on adapt data
2 parents 03d99a9 + 93c8e7f commit 07d3153

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
CRAN: ${{ matrix.cran }}
2929

3030
steps:
31-
- uses: actions/checkout@v1
31+
- uses: actions/checkout@v2
3232
- uses: r-lib/actions/setup-r@master
3333
- uses: r-lib/actions/setup-pandoc@master
3434
- name: Install system dependencies

R/layer-methods.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ as_node_index <- function(node_index) {
168168
#'
169169
#' @export
170170
adapt <- function(object, data, reset_state = NULL) {
171+
172+
if (!inherits(data, "python.builtin.object"))
173+
data <- keras_array(data)
174+
171175
# layers can implement adapt with different default reset_state
172176
if (is.null(reset_state))
173177
object$adapt(data)

0 commit comments

Comments
 (0)