Skip to content

Commit 62a396d

Browse files
committed
override tensorflow %*% S3 method
1 parent 1bdda97 commit 62a396d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
- `dotty::.` is now reexported.
1313

14+
- `%*%` now dispatches to `op_matmul()` for tensorflow tensors, which
15+
has relaxed shape constraints compared to `tf$matmul()`.
16+
1417
## Added compatibility with Keras v3.8.0. User-facing changes:
1518

1619
- New symbols:

R/package.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ keras <- NULL
5656
requireNamespace("tensorflow", quietly = TRUE)
5757
maybe_register_S3_methods()
5858

59+
registerS3method("%*%", "tensorflow.tensor", op_matmul, baseenv())
60+
5961
# if KERAS_PYTHON is defined then forward it to RETICULATE_PYTHON
6062
keras_python <- get_keras_python()
6163
if (!is.null(keras_python))

0 commit comments

Comments
 (0)