Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for RegisterGradient (0.26 sec)

  1. tensorflow/compiler/mlir/tfr/examples/mnist/ops_defs.py

        return tf.raw_ops.Relu(features=res)
      elif act == 'RELU6':
        return tf.raw_ops.Relu6(features=res)
      elif act == 'TANH':
        return tf.raw_ops.Tanh(x=res)
      else:
        return res
    
    
    @tf.RegisterGradient('NewConv2D')
    def _conv_add_relu_grad(op: ops.Operation, grad):
      act = op.get_attr('act')
      y = op.outputs[0]
      if act == 'RELU':
        grad = gen_nn_ops.relu_grad(grad, y)
      elif act == 'RELU6':
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Aug 31 20:23:51 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/ir/tf_generated_ops.td

    such that dx = g(dy). In Python,
    
    ```python
    with tf.get_default_graph().gradient_override_map(
        {'IdentityN': 'OverrideGradientWithG'}):
      y, _ = identity_n([f(x), x])
    
    @tf.RegisterGradient('OverrideGradientWithG')
    def ApplyG(op, dy, _):
      return [None, g(dy)]  # Do not backprop to f(x).
    ```
      }];
    
      let arguments = (ins
        Variadic<TF_Tensor>:$input
      );
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 23:24:08 UTC 2024
    - 793K bytes
    - Viewed (0)
Back to top