From d77af4df757870cd9648791fe95eb1ef0cf7f0d7 Mon Sep 17 00:00:00 2001 From: Aron Date: Wed, 10 Jan 2024 16:56:44 +0100 Subject: [PATCH] Add shape information to try to fix bug with python 3.11 --- n3fit/src/n3fit/layers/x_operations.py | 3 +++ n3fit/src/n3fit/msr.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/n3fit/src/n3fit/layers/x_operations.py b/n3fit/src/n3fit/layers/x_operations.py index a55b56d2ba..3ed9705b59 100644 --- a/n3fit/src/n3fit/layers/x_operations.py +++ b/n3fit/src/n3fit/layers/x_operations.py @@ -76,3 +76,6 @@ def __init__(self, grid_weights, x_axis=2, **kwargs): def call(self, pdf): return op.tensor_product(pdf, self.grid_weights, axes=[self.x_axis, 0]) + + def compute_output_shape(self, input_shape): + return input_shape[: self.x_axis] + input_shape[self.x_axis + 1 :] diff --git a/n3fit/src/n3fit/msr.py b/n3fit/src/n3fit/msr.py index e781a672d2..1bca92f2e1 100644 --- a/n3fit/src/n3fit/msr.py +++ b/n3fit/src/n3fit/msr.py @@ -85,7 +85,7 @@ def generate_msr_model_and_grid( )([x_divided, pdf_xgrid_integration]) # 4. Integrate the pdf - pdf_integrated = xIntegrator(weights_array, input_shape=(nx,))(pdf_integrand) + pdf_integrated = xIntegrator(weights_array, input_shape=(1, replicas, nx))(pdf_integrand) # 5. THe input for the photon integral, will be set to 0 if no photons photon_integral = Input(shape=(replicas, 1), batch_size=1, name='photon_integral')