Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- import numpy as np
- import tensorflow.contrib.layers as lay
- X = tf.constant([[1,2],[3,4]],dtype=tf.float32)
- with tf.variable_scope("fc1",reuse=tf.AUTO_REUSE) as scope:
- w = tf.get_variable("weights",initializer=tf.constant([[1,1],[1,1]],dtype=tf.float32))
- fc1 = lay.fully_connected(X,2,scope=scope,biases_initializer=tf.initializers.zeros)
- vars = tf.global_variables("fc1")
- sess = tf.Session()
- sess.run(tf.global_variables_initializer())
- print(vars)
- res = sess.run(fc1)
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement