Created
November 26, 2019 20:50
-
-
Save zaghaghi/65382da570f300b946b0c81bdacfd4d7 to your computer and use it in GitHub Desktop.
Node Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, input_nodes=[]): | |
# گرههایی که مقدار به این گره ارسال میکنند | |
self.input_nodes = input_nodes | |
# گرههایی که این نود به آنها مقدار ارسال میکند | |
self.output_nodes = [] | |
# این گره را به عنوان گره خروجی تمامی گرههای ورودی اضافه میکنیم | |
for n in self.input_nodes: | |
n.output_nodes.append(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment