Skip to content

Commit

Permalink
Add shape information to try to fix bug with python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
APJansen committed Jan 10, 2024
1 parent 997451b commit d77af4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions n3fit/src/n3fit/layers/x_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 :]
2 changes: 1 addition & 1 deletion n3fit/src/n3fit/msr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d77af4d

Please sign in to comment.