Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspect if model2function ops are placed on a device during function creation or when the function is called #15

Open
matiaslindgren opened this issue Nov 12, 2020 · 0 comments

Comments

@matiaslindgren
Copy link
Member

lidbox/lidbox/util.py

Lines 101 to 106 in 49c27a0

def model2function(model):
model_input = model.inputs[0]
model_fn = tf.function(
lambda x: model(x, training=False),
input_signature=[tf.TensorSpec(model_input.shape, model_input.dtype)])
return model_fn.get_concrete_function()

@matiaslindgren matiaslindgren changed the title Inspect if model2function ops are placed on a device during model creation or when the function is called Inspect if model2function ops are placed on a device during function creation or when the function is called Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant