(self, operation: Operation)
| 292 | return self._detail |
| 293 | |
| 294 | def append_operation(self, operation: Operation): |
| 295 | if not isinstance(operation, Operation): |
| 296 | raise TypeError(f'You can only insert operations via this function, however {type(operation)} was given.') |
| 297 | if not all([var.name in self.variables for var in operation.inputs + operation.outputs]): |
| 298 | raise KeyError(f'Inserting Operation {operation} has a related variable '\ |
| 299 | 'which are not included in this graph yet, insert such variables before inserting this.') |
| 300 | if operation.name in self.operations: |
| 301 | raise KeyError(f'Duplicated Operation({operation}) was found, rename your Operation before inserting.') |
| 302 | self.operations[operation.name] = operation |
| 303 | |
| 304 | def append_variable(self, var: Variable): |
| 305 | if not isinstance(var, Variable): |
no outgoing calls
no test coverage detected