74796ff02e9425ca336f595978fe6e7c422c0378,tensorlayer/layers.py,,get_variables_with_name,#Any#Any#Any#,149

Before Change


    >>> dense_vars = get_variable_with_name("dense", True, True)
    
    print("  Get variables with %s" % name)
    t_vars = tf.trainable_variables() if train_only else tf.all_variables()
    d_vars = [var for var in t_vars if name in var.name]
    if printable:
        for idx, v in enumerate(d_vars):
            print("  got {:3}: {:15}   {}".format(idx, v.name, str(v.get_shape())))

After Change


    
    print("  [*] geting variables with %s" % name)
    // tvar = tf.trainable_variables() if train_only else tf.all_variables()
    if train_only:
        t_vars = tf.trainable_variables()
    else:
        try: // TF1.0
            t_vars = tf.global_variables()
        except: // TF0.12
            t_vars = tf.all_variables()

    d_vars = [var for var in t_vars if name in var.name]
    if printable:
        for idx, v in enumerate(d_vars):
            print("  got {:3}: {:15}   {}".format(idx, v.name, str(v.get_shape())))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name:
Method Name: get_variables_with_name


Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name:
Method Name: get_variables_with_name


Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name:
Method Name: print_all_variables


Project Name: tensorlayer/tensorlayer
Commit Name: ba5ed06df57e3146b3ff9f2268b6bf49d0651e99
Time: 2017-02-16
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name:
Method Name: get_variables_with_name


Project Name: tensorlayer/tensorlayer
Commit Name: ba5ed06df57e3146b3ff9f2268b6bf49d0651e99
Time: 2017-02-16
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name:
Method Name: print_all_variables