🎨 Format Python code with psf/black
This commit is contained in:
@@ -64,17 +64,24 @@ class AveragingNeuralOperator(KernelNeuralOperator):
|
|||||||
output_lifting_net = lifting_net(
|
output_lifting_net = lifting_net(
|
||||||
torch.rand(size=next(lifting_net.parameters()).size())
|
torch.rand(size=next(lifting_net.parameters()).size())
|
||||||
).shape[-1]
|
).shape[-1]
|
||||||
projecting_net_input=next(projecting_net.parameters()).size()[-1]
|
projecting_net_input = next(projecting_net.parameters()).size()[-1]
|
||||||
|
|
||||||
if len(field_indices)+len(coordinates_indices) != input_lifting_net:
|
if len(field_indices) + len(coordinates_indices) != input_lifting_net:
|
||||||
raise ValueError('The lifting_net must take as input the '
|
raise ValueError(
|
||||||
'coordinates vector and the field vector.')
|
"The lifting_net must take as input the "
|
||||||
|
"coordinates vector and the field vector."
|
||||||
|
)
|
||||||
|
|
||||||
if output_lifting_net+len(coordinates_indices) != projecting_net_input:
|
if (
|
||||||
raise ValueError('The projecting_net input must be equal to'
|
output_lifting_net + len(coordinates_indices)
|
||||||
'the embedding dimension (which is the output) '
|
!= projecting_net_input
|
||||||
'of the lifting_net plus the dimension of the '
|
):
|
||||||
'coordinates, i.e. len(coordinates_indices).')
|
raise ValueError(
|
||||||
|
"The projecting_net input must be equal to"
|
||||||
|
"the embedding dimension (which is the output) "
|
||||||
|
"of the lifting_net plus the dimension of the "
|
||||||
|
"coordinates, i.e. len(coordinates_indices)."
|
||||||
|
)
|
||||||
|
|
||||||
# assign
|
# assign
|
||||||
self.coordinates_indices = coordinates_indices
|
self.coordinates_indices = coordinates_indices
|
||||||
|
|||||||
Reference in New Issue
Block a user