Skip to content

Instantly share code, notes, and snippets.

@yaroslavvb
Created March 7, 2017 20:02
Show Gist options
  • Save yaroslavvb/63c0459225b176b797607e660022b11f to your computer and use it in GitHub Desktop.
Save yaroslavvb/63c0459225b176b797607e660022b11f to your computer and use it in GitHub Desktop.
utility to copy initializer for one variable to another
def copy_initializer(from_var, to_var):
from tensorflow.contrib import graph_editor as ge
assert ge.reroute_a2b_ts(from_var.initial_value, to_var.initial_value), "No copy took place"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment