-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
The correct one:
with tf.variable_scope(scope) as scope:
w = tf.get_variable("weights", [x.shape[1], out_dim], initializer=tf.random_normal_initializer())
b = tf.get_variable("biases", [out_dim], initializer=tf.constant_initializer(0.0))
The following code will raise the error: TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [Dimension(100), 50]. Consider casting elements to a supported type.
with tf.variable_scope(scope) as scope:
w = tf.get_variable(initializer=tf.random_normal([x.shape[1], out_dim]), name='weights')
b = tf.get_variable(initializer=tf.zeros([out_dim]), name='biases')
What's happened?
Metadata
Metadata
Assignees
Labels
No labels