From aa114f7b694f1f81ab7a3e3b2f691fbfb1729fd2 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 12 May 2025 22:59:05 +0200 Subject: [PATCH] Remove iostream include for C backend --- pytensor/link/c/cmodule.py | 2 +- pytensor/tensor/blas.py | 4 +--- pytensor/tensor/special.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pytensor/link/c/cmodule.py b/pytensor/link/c/cmodule.py index 3d6cd55a4c..da20c4b167 100644 --- a/pytensor/link/c/cmodule.py +++ b/pytensor/link/c/cmodule.py @@ -157,7 +157,7 @@ def __init__(self, name=None): self.support_code = [] self.functions = [] - self.includes = ["", "", '"pytensor_mod_helper.h"'] + self.includes = ["", '"pytensor_mod_helper.h"'] self.init_blocks = [] def print_methoddef(self, stream): diff --git a/pytensor/tensor/blas.py b/pytensor/tensor/blas.py index 7df8d8b675..0977b500a6 100644 --- a/pytensor/tensor/blas.py +++ b/pytensor/tensor/blas.py @@ -472,9 +472,7 @@ def c_support_code(self, **kwargs): return blas_header_text() + mod_str def c_headers(self, **kwargs): - # std.cout doesn't require the '%' symbol to print stuff... - # so it works much better with python's string-substitution stuff. - return [""] + return [] def c_libraries(self, **kwargs): return ldflags() diff --git a/pytensor/tensor/special.py b/pytensor/tensor/special.py index 5b05ad03f4..df7edf05ad 100644 --- a/pytensor/tensor/special.py +++ b/pytensor/tensor/special.py @@ -294,7 +294,7 @@ def infer_shape(self, fgraph, node, shape): return shape def c_headers(self, **kwargs): - return ["", ""] + return [""] def c_support_code_apply(self, node: Apply, name: str) -> str: """Needed to define NPY_RAVEL_AXIS"""