Exemple #1
0
 def wrapper(*args, **kwargs):
     new_layer = layers.create_layer(layer, self, *args, **kwargs)
     if kwargs.get("output_to_metrics", False):
         new_layer.export_output_for_metrics()
     if kwargs.get("params_to_metrics", False):
         new_layer.export_params_for_metrics()
     return self.add_layer(new_layer)
 def wrapper(*args, **kwargs):
     new_layer = layers.create_layer(layer, self, *args, **kwargs)
     if kwargs.get("output_to_metrics", False):
         new_layer.export_output_for_metrics()
     if kwargs.get("params_to_metrics", False):
         new_layer.export_params_for_metrics()
     return self.add_layer(new_layer)
 def wrapper(*args, **kwargs):
     def apply_operator(net, in_record, out_record):
         # TODO(amalevich): Switch to net.operator as soon as it gets
         # landed
         net.__getattr__(layer)(in_record.field_blobs(),
                                out_record.field_blobs(),
                                **kwargs)
     if 'name' not in kwargs:
         kwargs['name'] = layer
     return self.add_layer(
         layers.create_layer('Functional',
                             self, *args, function=apply_operator,
                             **kwargs))
Exemple #4
0
            def wrapper(*args, **kwargs):
                def apply_operator(net, in_record, out_record, **kwargs):
                    # TODO(amalevich): Switch to net.operator as soon as it gets
                    # landed
                    net.__getattr__(layer)(in_record.field_blobs(),
                                           out_record.field_blobs(),
                                           **kwargs)

                if 'name' not in kwargs:
                    kwargs['name'] = layer
                return self.add_layer(
                    layers.create_layer('Functional',
                                        self, *args, function=apply_operator,
                                        **kwargs))
Exemple #5
0
            def wrapper(*args, **kwargs):
                def apply_operator(net, in_record, out_record):
                    # core.Net will throw exception if output_dtypes is set
                    # in Functional layer because MakeArgment() cannot recognize
                    # it. Just remove it from kwargs.
                    clean_kwargs = dict(kwargs)
                    if 'output_dtypes' in clean_kwargs:
                        del clean_kwargs['output_dtypes']

                    # TODO(amalevich): Switch to net.operator as soon as it gets
                    # landed
                    net.__getattr__(layer)(in_record.field_blobs(),
                                           out_record.field_blobs(),
                                           **clean_kwargs)
                if 'name' not in kwargs:
                    kwargs['name'] = layer
                return self.add_layer(
                    layers.create_layer('Functional',
                                        self, *args, function=apply_operator,
                                        **kwargs))
Exemple #6
0
            def wrapper(*args, **kwargs):
                def apply_operator(net, in_record, out_record, **kwargs):
                    # TODO(amalevich): Switch to net.operator as soon as it gets
                    # landed
                    net.__getattr__(layer)(in_record.field_blobs(),
                                           out_record.field_blobs(), **kwargs)

                if 'name' not in kwargs:
                    kwargs['name'] = layer

                new_layer = layers.create_layer('Functional',
                                                self,
                                                *args,
                                                function=apply_operator,
                                                **kwargs)

                if kwargs.get("output_to_metrics", False):
                    new_layer.export_output_for_metrics()
                if kwargs.get("params_to_metrics", False):
                    new_layer.export_params_for_metrics()

                return self.add_layer(new_layer)
            def wrapper(*args, **kwargs):
                def apply_operator(net, in_record, out_record, **kwargs):
                    # TODO(amalevich): Switch to net.operator as soon as it gets
                    # landed
                    net.__getattr__(layer)(in_record.field_blobs(),
                                           out_record.field_blobs(),
                                           **kwargs)

                if 'name' not in kwargs:
                    kwargs['name'] = layer

                new_layer = layers.create_layer(
                    'Functional',
                    self, *args, function=apply_operator,
                    **kwargs
                )

                if kwargs.get("output_to_metrics", False):
                    new_layer.export_output_for_metrics()
                if kwargs.get("params_to_metrics", False):
                    new_layer.export_params_for_metrics()

                return self.add_layer(new_layer)
 def wrapper(*args, **kwargs):
     return self.add_layer(
         layers.create_layer(layer, self, *args, **kwargs))
Exemple #9
0
 def wrapper(*args, **kwargs):
     return self.add_layer(
         layers.create_layer(layer, self, *args, **kwargs))