def first_field_schema_init(self, model, input_record, *args, **kwargs): ModelLayer.__init__(self, model, self.operator, input_record, **kwargs) assert self.operator is not None, "Try to create invalid operator layer" assert isinstance(input_record, schema.Struct),\ "Operator {0} expects schema.Struct as input, received {1} instead".\ format(self.operator, input_record) self.args = args self.output_schema = schema.NewRecord(self.model.net, input_record[0])
def simple_init(self, model, input_record, *args, **kwargs): ModelLayer.__init__(self, model, self.operator, input_record, **kwargs) assert self.operator is not None, "Try to create invalid operator layer" self.args = args self.output_schema = schema.NewRecord(self.model.net, input_record)