# NOT RUN {
tf_imperative({
a <- tf$constant(list(list(7), list(6)))
b <- tf$constant(list(list(6, 7)))
list(
tf$matmul(a, b),
a * 4
)
})
# This is equivalent to the following:
tf <- tf$contrib$imperative
a <- tf$constant(list(list(7), list(6)))
b <- tf$constant(list(list(6, 7)))
res1 <- tf$matmul(a, b)
res2 <- a * 4
list(res1$eval(), res2$eval())
# }
Run the code above in your browser using DataLab