brainstorm/layers/base_layer.py
def _validate_connections(self):
        """
        Ensure all incoming and outgoing connections are valid.

        Raises:
            LayerValidationError: if there is any:
                * incoming connection to a non-existent input
                * outgoing connection from a non-existent output, parameter
                  or internal buffer
        """
        for in_c in self.incoming:
            if in_c.input_name not in self.in_shapes:
                raise LayerValidationError(
                    '{}: Invalid incoming connection ({}). Layer has no input '
                    'named "{}"'.format(self.name, in_c, in_c.sink_name))

        for out_c in self.outgoing:
            if out_c.output_name.startswith('..'):
                category, _, substruct = out_c.output_name[2:].partition('.')
                if category not in {'parameters', 'internals'}:
                    raise LayerValidationError(
                        "{}: Invalid outgoing connection ({}). Category '{}' "
                        "is not allowed/does not exist. Choices are "
                        "['parameters', 'internals']".format(self.name, out_c,
                                                             category))
                if category == 'parameters':
                    parameters = self.parameter_shapes
                    if substruct not in parameters:
                        raise LayerValidationError(
                            "{}: Invalid outgoing connection ({}). Parameter"
                            " '{}' does not exist. Choices are {}".format(
                                self.name, out_c, substruct,
                                list(parameters.keys())))

                if category == 'internals':
                    internals = self.internal_shapes
                    if substruct not in internals:
                        raise LayerValidationError(
                            "{}: Invalid outgoing connection ({}). Internal"
                            " '{}' does not exist. Choices are {}".format(
                                self.name, out_c, substruct,
                                list(internals.keys())))

            elif out_c.output_name not in self.out_shapes:
                raise LayerValidationError(
                    '{}: Invalid outgoing connection ({}). Layer has no output'
                    ' named "{}". Choices are: {}'.format(
                        self.name, out_c, out_c.output_name,
                        list(self.out_shapes.keys())))

        Ensure all incoming and outgoing connections are valid.

        Raises:
            LayerValidationError: if there is any:
                * incoming connection to a non-existent input
                * outgoing connection from a non-existent output, parameter
                  or internal buffer
        
Ensure all incoming and outgoing connections are valid.
Ensure all incoming and outgoing connections are valid .
def _validate_connections(self):
        for in_c in self.incoming:
            if in_c.input_name not in self.in_shapes:
                raise LayerValidationError(
                    '{}: Invalid incoming connection ({}). Layer has no input '
                    'named "{}"'.format(self.name, in_c, in_c.sink_name))
        for out_c in self.outgoing:
            if out_c.output_name.startswith('..'):
                category, _, substruct = out_c.output_name[2:].partition('.')
                if category not in {'parameters', 'internals'}:
                    raise LayerValidationError(
                        "{}: Invalid outgoing connection ({}). Category '{}' "
                        "is not allowed/does not exist. Choices are "
                        "['parameters', 'internals']".format(self.name, out_c,
                                                             category))
                if category == 'parameters':
                    parameters = self.parameter_shapes
                    if substruct not in parameters:
                        raise LayerValidationError(
                            "{}: Invalid outgoing connection ({}). Parameter"
                            " '{}' does not exist. Choices are {}".format(
                                self.name, out_c, substruct,
                                list(parameters.keys())))
                if category == 'internals':
                    internals = self.internal_shapes
                    if substruct not in internals:
                        raise LayerValidationError(
                            "{}: Invalid outgoing connection ({}). Internal"
                            " '{}' does not exist. Choices are {}".format(
                                self.name, out_c, substruct,
                                list(internals.keys())))
            elif out_c.output_name not in self.out_shapes:
                raise LayerValidationError(
                    '{}: Invalid outgoing connection ({}). Layer has no output'
                    ' named "{}". Choices are: {}'.format(
                        self.name, out_c, out_c.output_name,
                        list(self.out_shapes.keys())))
def _validate_connections ( self ) : for in_c in self . incoming : if in_c . input_name not in self . in_shapes : raise LayerValidationError ( '{}: Invalid incoming connection ({}). Layer has no input ' 'named "{}"' . format ( self . name , in_c , in_c . sink_name ) ) for out_c in self . outgoing : if out_c . output_name . startswith ( '..' ) : category , _ , substruct = out_c . output_name [ 2 : ] . partition ( '.' ) if category not in { 'parameters' , 'internals' } : raise LayerValidationError ( "{}: Invalid outgoing connection ({}). Category '{}' " "is not allowed/does not exist. Choices are " "['parameters', 'internals']" . format ( self . name , out_c , category ) ) if category == 'parameters' : parameters = self . parameter_shapes if substruct not in parameters : raise LayerValidationError ( "{}: Invalid outgoing connection ({}). Parameter" " '{}' does not exist. Choices are {}" . format ( self . name , out_c , substruct , list ( parameters . keys ( ) ) ) ) if category == 'internals' : internals = self . internal_shapes if substruct not in internals : raise LayerValidationError ( "{}: Invalid outgoing connection ({}). Internal" " '{}' does not exist. Choices are {}" . format ( self . name , out_c , substruct , list ( internals . keys ( ) ) ) ) elif out_c . output_name not in self . out_shapes : raise LayerValidationError ( '{}: Invalid outgoing connection ({}). Layer has no output' ' named "{}". Choices are: {}' . format ( self . name , out_c , out_c . output_name , list ( self . out_shapes . keys ( ) ) ) )
Ensure all incoming and outgoing connections are valid.
Ensure all incoming and outgoing connections are valid .
"""
        Ensure all incoming and outgoing connections are valid.

        Raises:
            LayerValidationError: if there is any:
                * incoming connection to a non-existent input
                * outgoing connection from a non-existent output, parameter
                  or internal buffer
        """
if there is any:
incoming connection to a non-existent input
outgoing connection from a non-existent output, parameter
or internal buffer
if there is any : incoming connection to a non - existent input outgoing connection from a non - existent output parameter or internal buffer
LayerValidationError
self