deepr.utils.Field
- class deepr.utils.Field(name, shape, dtype, default=None, sequence=None)[source]
Convenient way to define fields for features.
- default
Default value of the field for padding
- Type:
Any
- dtype
Tensorflow type of the field (automatically inferred if string)
- Type:
tf.DType
- sequence
If True, the field represents a sequence.
Used for
tf.Example
message serialization : ifsequence
isTrue
, the field with be stored in thefeature_list
entry of atf.train.SequenceExample
.Automatically set if not given :
True
ifshape
’s first dimension isNone
.- Type:
- shape
Shape of the field
- Type:
Tuple
Methods
__init__
(name, shape, dtype[, default, sequence])as_placeholder
([batch])- rtype:
placeholder
is_featurizable
()- rtype:
is_sparse
()- rtype:
startswith
(prefix)to_feature
(value)Convert value to tf.train.Feature or tf.train.FeatureList.
Attributes
batch_shape
feature_specs
Return feature specs for parsing Example messages.