Esempio n. 1
0
def mat_mul(a, b, name=None):
    ctx = context.get_default()
    tape = tape_stack.get_default()
    grad_registry = gradient_registry.get_global_registry()
    return _math_ops.mat_mul(ctx, a, b, name, tape, grad_registry)
Esempio n. 2
0
def sparse_softmax_cross_entropy_with_logits(logits, labels, name=None):
    ctx = context.get_default()
    tape = tape_stack.get_default()
    grad_registry = gradient_registry.get_global_registry()
    return _nn_ops.sparse_softmax_cross_entropy_with_logits(
        ctx, logits, labels, name, tape, grad_registry)
 def __enter__(self):
   """Enters a context inside which operations are recorded on this tape."""
   if tape_stack.get_default():
     raise ValueError("Nested tapes are not supported yet.")
   tape_stack.push(self._c_tape)
   return self
Esempio n. 4
0
def relu(a, name=None):
    ctx = context.get_default()
    tape = tape_stack.get_default()
    grad_registry = gradient_registry.get_global_registry()
    return _nn_ops.relu(ctx, a, name, tape, grad_registry)