提交 8b15bf2b authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Remove unused Raise Op

上级 c03031a3
......@@ -7,7 +7,7 @@ import numpy as np
from aesara.gradient import DisconnectedType
from aesara.graph.basic import Apply, Variable
from aesara.graph.op import COp, Op
from aesara.graph.op import COp
from aesara.graph.params_type import ParamsType
from aesara.graph.type import Generic
......@@ -23,29 +23,6 @@ class ExceptionType(Generic):
exception_type = ExceptionType()
class Raise(Op):
"""Op whose perform() raises an exception."""
__props__ = ("msg", "exc")
def __init__(self, msg="", exc=NotImplementedError):
"""
msg - the argument to the exception
exc - an exception class to raise in self.perform
"""
self.msg = msg
self.exc = exc
def __str__(self):
return f"Raise{{{self.exc}({self.msg})}}"
def make_node(self, x):
return Apply(self, [x], [x.type()])
def perform(self, node, inputs, out_storage):
raise self.exc(self.msg)
class CheckAndRaise(COp):
"""An `Op` that checks conditions and raises an exception if they fail.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论