'x': schema_pb2.IntDomain(min=0, max=5, is_categorical=True)
     }
 },
 {
     'testcase_name': 'string_domain',
     'ascii_proto': """
       feature: {
         name: "x" type: BYTES
         string_domain {value: "a" value: "b"}
       }
     """,
     'feature_spec': {
         'x': tf.io.VarLenFeature(tf.string)
     },
     'domains': {
         'x': schema_pb2.StringDomain(value=['a', 'b'])
     }
 },
 {
     'testcase_name': 'float_domain',
     'ascii_proto': """
       feature: {
         name: "x" type: FLOAT
         float_domain {min: 0.0 max: 0.5}
       }
     """,
     'feature_spec': {
         'x': tf.io.VarLenFeature(tf.float32)
     },
     'domains': {
         'x': schema_pb2.FloatDomain(min=0.0, max=0.5)
Esempio n. 2
0
    'feature_name':
    'x',
    'domain':
    schema_pb2.FloatDomain(min=1.1, max=5.1),
    'output_schema_proto_text':
    '''
          feature { name: 'x' float_domain { min: 1.1 max: 5.1 } }'''
}, {
    'testcase_name':
    'string_domain',
    'input_schema_proto_text':
    '''feature { name: 'x' }''',
    'feature_name':
    'x',
    'domain':
    schema_pb2.StringDomain(value=['a', 'b']),
    'output_schema_proto_text':
    '''
          feature { name: 'x' string_domain { value: 'a' value: 'b' } }'''
}, {
    'testcase_name':
    'bool_domain',
    'input_schema_proto_text':
    '''feature { name: 'x' }''',
    'feature_name':
    'x',
    'domain':
    schema_pb2.BoolDomain(true_value='T', false_value='F'),
    'output_schema_proto_text':
    '''
          feature { name: 'x' bool_domain { true_value: 'T' false_value: 'F' } }