-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing Op.infer_shape
implementations
#547
Comments
No idea how bad this is: from types import ModuleType
import aesara
def find_ops_in_modules(module, modules_visited, ops):
for key, value in module.__dict__.items():
if isinstance(value, aesara.graph.op.Op):
if (
not hasattr(value, "infer_shape")
and not isinstance(value, aesara.tensor.elemwise.Elemwise)
and not isinstance(value, aesara.scalar.basic.ScalarOp)
and key not in ops
):
ops.add(key)
print(module.__name__, key)
continue
if isinstance(value, ModuleType):
if value not in modules_visited:
modules_visited.add(value)
find_ops_in_modules(value, modules_visited, ops)
ops = set()
modules_visited = set()
find_ops_in_modules(aesara, modules_visited, ops)
|
That's exactly what we need to do; automate the search for things like this! It might be possible to use the Aside from |
Oops I was printing repeated entries from different modules. Updated the list (also the DeepCopy is already done in main) |
Also, I don't think |
I tried to filter them with |
It might help to have an explicit interface (e.g. a type/class) for |
The others I am not familiar with: |
Yeah, that one should have an |
shape_infer
implementationsOp.infer_shape
implementations
We need to do a survey of the
Op
s and see which ones are still missingshape_infer
implementations. In general, we want to make sure that we're not unnecessarily evaluating graphs just to get their shapes.DeepCopyOp.infer_shape
#560The text was updated successfully, but these errors were encountered: