(self, var: Variable)
| 302 | self.operations[operation.name] = operation |
| 303 | |
| 304 | def append_variable(self, var: Variable): |
| 305 | if not isinstance(var, Variable): |
| 306 | raise TypeError(f'You can only insert variable via this function, however {type(var)} was given.') |
| 307 | if not all([dest_op.name in self.operations for dest_op in var.dest_ops]): |
| 308 | raise KeyError(f'Inserting Variable {var} has a related Operation(dest_op) '\ |
| 309 | 'which are not included in this graph yet, insert such Operations before inserting this.') |
| 310 | if var.name in self.variables: |
| 311 | raise KeyError(f'Duplicated Variable({var}) was found, rename your Variable before inserting.') |
| 312 | self.variables[var.name] = var |
| 313 | |
| 314 | def get_downstream_operations(self, operation: Operation) -> List[Operation]: |
| 315 | if not isinstance(operation, Operation): |
no outgoing calls
no test coverage detected