Compute node
FunctionNode
Bases: Node
Subclass of node specialized for nodes that does computation (e.g. torch.functions)
Source code in torchview/computation_node/compute_node.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
set_node_id(output_id=None)
Sets the id of FunctionNode. If no output is given, it sets to value unique to node. If output id is given, id is determined by only id of nn.module object This is crucial when rolling recursive modules by identifying them with this id mechanism
Source code in torchview/computation_node/compute_node.py
133 134 135 136 137 138 139 140 141 142 |
|
ModuleNode
Bases: Node
Subclass of node specialzed for storing torch Module info
Source code in torchview/computation_node/compute_node.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
set_node_id(output_id=None)
Sets the id of ModuleNode. If no output is given, it sets to value unique to node. If output id is given, there are 2 cases: 1. Parameterless module: id is determined by output_id and id of nn.Module 2. Module with parameter: id is determined by only id of nn.module object This is crucial when rolling recursive modules by identifying them with this id mechanism
Source code in torchview/computation_node/compute_node.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
TensorNode
Bases: Node
Subclass of node specialzed for nodes that stores tensor (subclass of torch.Tensor called RecorderTensor)
Source code in torchview/computation_node/compute_node.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|