Ejemplo n.º 1
0
class BaseConvert(ValueOp):

    input_type = [
        rules.one_of([integer, string]),
        integer(name='from_base'),
        integer(name='to_base')
    ]
    output_type = rules.shape_like_flatargs('string')
Ejemplo n.º 2
0
def _operation_type_conversion(inputs, output):
    in_type = [validate_type(x) for x in inputs]
    in_values = [rules.value_typed_as(_convert_types(x)) for x in in_type]
    out_type = validate_type(output)
    out_value = rules.shape_like_flatargs(out_type)
    return (in_values, out_value)
Ejemplo n.º 3
0
class StringJoin(ValueOp):

    input_type = [string(name='sep'), list_of(string, min_length=1)]
    output_type = rules.shape_like_flatargs('string')
Ejemplo n.º 4
0
 def _type_signature(self, inputs, output):
     input_type = _to_input_sig(inputs)
     output = validate_type(output)
     output_type = rules.shape_like_flatargs(output)
     return input_type, output_type
Ejemplo n.º 5
0
 def _type_signature(self, inputs, output):
     input_type = _to_input_sig(inputs)
     output = validate_type(output)
     output_type = rules.shape_like_flatargs(output)
     return input_type, output_type
Ejemplo n.º 6
0
def _operation_type_conversion(inputs, output):
    in_type = [ir._validate_type(x) for x in inputs]
    in_values = [rules.value_typed_as(_convert_types(x)) for x in in_type]
    out_type = ir._validate_type(output)
    out_value = rules.shape_like_flatargs(out_type)
    return (in_values, out_value)