Negative
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class negative(Operation):
"""Computes the negative of x element-wise.
"""
def __init__(self, x):
"""Construct negative
Args:
x: Input node
"""
super().__init__([x])
def compute(self, x_value):
"""Compute the output of the negative operation
Args:
x_value: Input value
"""
return -x_value
Enter to Rename, Shift+Enter to Preview