title: How do I define my own operators in TensorFlow
body: <p>In TensorFlow, we can use <code>tf.nn.l2_loss()</code> for doing L2 regularization. Let's say I want to define my own regularization operator for L1 regularization (call it <code>tf.nn.l1_loss()</code>). How would I go about it? I am having a hard time locating operator definitions in the TensorFlow source code.</p>