MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / model_fn

Function model_fn

tensorflow/python/ops/parallel_for/gradients_test.py:170–175  ·  view source on GitHub ↗
(activation)

Source from the content-addressed store, hash-verified

168 projection = tf_layers.Dense(1)
169
170 def model_fn(activation):
171 for layer in layers:
172 activation = layer(activation)
173 activation = projection(activation)
174 activation = nn.l2_loss(activation)
175 return gradient_ops.gradients(activation, variables.trainable_variables())
176
177 def loop_fn(i):
178 return model_fn(array_ops.expand_dims(array_ops.gather(inp, i), 0))

Callers 1

loop_fnFunction · 0.70

Calls 1

trainable_variablesMethod · 0.45

Tested by

no test coverage detected