zita
zita

Reputation: 17

TypeError: tf.shape is not a function

I am trying to convert some python tensorflow code to javascript. tensorflow js has no attribute shape like tensorflow. Is there a way to convert this line of code ? module 'tensorflowjs' has no attribute 'shape'

import tensorflowjs as tfjs
input_shape = [1, 1, 256]  
tfjs.shape(input_shape)

AttributeError: module 'tensorflowjs' has no attribute 'shape'

Upvotes: 0

Views: 435

Answers (1)

Matvii Hodovaniuk
Matvii Hodovaniuk

Reputation: 513

shape is second attribute for create tensor function.

tf.tensor (values, shape?, dtype?) 

Documentation

Upvotes: 1

Related Questions