diff --git a/aesara/tensor/type.py b/aesara/tensor/type.py index 37324ee92c..28e55c3b9a 100644 --- a/aesara/tensor/type.py +++ b/aesara/tensor/type.py @@ -315,9 +315,7 @@ def is_super(self, otype): return False def convert_variable(self, var): - if self.is_super(var.type) and not isinstance( - var.type, aesara.sparse.SparseType - ): + if self.is_super(var.type) and isinstance(var.type, DenseTensorType): # `var.type` is at least as specific as `self`, so we return # `var` as-is return var