human
I am working on the file "18-05-28-Complete-Guide-to-Tensorflow-for-Deep-Learning-with-Python/01-Introduction-to-Neural-Networks/01_Neural Network From Scratch.ipynb".
The first task is:
Operation
Can you write Python program for it?
assistant
#Here is the Python program you requested.

class Operation():
    """
    An Operation is a node in a "Graph". TensorFlow will also use this concept of a Graph.
    
    This Operation class will be inherited by other classes that actually compute the specific
    operation, such as adding or matrix multiplication.
    """
    def __init__(self, input_nodes = []):
        """
        Intialize an Operation
        """
        # The list of input nodes
        self.input_nodes = input_nodes 
        
        # Initialize list of nodes consuming this node's output
        self.output_nodes = [] 
        
        # For every node in the input, we append this operation (self) to the list of
        # the consumers of the input nodes
        for node in input_nodes:
            node.output_nodes.append(self)
        
        # There will be a global default graph (TensorFlow works this way)
        # We will then append this particular operation
        # Append this operation to the list of operations in the currently active default graph
        _default_graph.operations.append(self)
  
    def compute(self):
        """ 
        This is a placeholder function. It will be overwritten by the actual specific operation
        that inherits from this class.
        """
        pass