Class SparseFeature

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable, SparseFeatureOrBuilder

    public final class SparseFeature
    extends com.google.protobuf.GeneratedMessageV3
    implements SparseFeatureOrBuilder
     A sparse feature represents a sparse tensor that is encoded with a
     combination of raw features, namely index features and a value feature. Each
     index feature defines a list of indices in a different dimension.
     
    Protobuf type tensorflow.metadata.v0.SparseFeature
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasName

        public boolean hasName()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        hasName in interface SparseFeatureOrBuilder
        Returns:
        Whether the name field is set.
      • getName

        public String getName()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getName in interface SparseFeatureOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Name for the sparse feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getNameBytes in interface SparseFeatureOrBuilder
        Returns:
        The bytes for name.
      • hasDeprecated

        @Deprecated
        public boolean hasDeprecated()
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Specified by:
        hasDeprecated in interface SparseFeatureOrBuilder
        Returns:
        Whether the deprecated field is set.
      • getDeprecated

        @Deprecated
        public boolean getDeprecated()
        Deprecated.
         This field is no longer supported. Instead, use:
         lifecycle_stage: DEPRECATED
         TODO(b/111450258): remove this.
         
        optional bool deprecated = 2 [deprecated = true];
        Specified by:
        getDeprecated in interface SparseFeatureOrBuilder
        Returns:
        The deprecated.
      • hasLifecycleStage

        public boolean hasLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Specified by:
        hasLifecycleStage in interface SparseFeatureOrBuilder
        Returns:
        Whether the lifecycleStage field is set.
      • getLifecycleStage

        public LifecycleStage getLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 7;
        Specified by:
        getLifecycleStage in interface SparseFeatureOrBuilder
        Returns:
        The lifecycleStage.
      • hasPresence

        @Deprecated
        public boolean hasPresence()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
        Specified by:
        hasPresence in interface SparseFeatureOrBuilder
        Returns:
        Whether the presence field is set.
      • getPresence

        @Deprecated
        public FeaturePresence getPresence()
        Deprecated.
         Constraints on the presence of this feature in examples.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeaturePresence presence = 4 [deprecated = true];
        Specified by:
        getPresence in interface SparseFeatureOrBuilder
        Returns:
        The presence.
      • hasDenseShape

        public boolean hasDenseShape()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        hasDenseShape in interface SparseFeatureOrBuilder
        Returns:
        Whether the denseShape field is set.
      • getDenseShape

        public FixedShape getDenseShape()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        getDenseShape in interface SparseFeatureOrBuilder
        Returns:
        The denseShape.
      • getDenseShapeOrBuilder

        public FixedShapeOrBuilder getDenseShapeOrBuilder()
         Shape of the sparse tensor that this SparseFeature represents.
         Currently not supported.
         TODO(b/109669962): Consider deriving this from the referred features.
         
        optional .tensorflow.metadata.v0.FixedShape dense_shape = 5;
        Specified by:
        getDenseShapeOrBuilder in interface SparseFeatureOrBuilder
      • getIndexFeatureCount

        public int getIndexFeatureCount()
         Features that represent indexes. Should be integers >= 0.
         
        repeated .tensorflow.metadata.v0.SparseFeature.IndexFeature index_feature = 6;
        Specified by:
        getIndexFeatureCount in interface SparseFeatureOrBuilder
      • hasIsSorted

        public boolean hasIsSorted()
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Specified by:
        hasIsSorted in interface SparseFeatureOrBuilder
        Returns:
        Whether the isSorted field is set.
      • getIsSorted

        public boolean getIsSorted()
         If true then the index values are already sorted lexicographically.
         
        optional bool is_sorted = 8;
        Specified by:
        getIsSorted in interface SparseFeatureOrBuilder
        Returns:
        The isSorted.
      • hasValueFeature

        public boolean hasValueFeature()
         required
         
        optional .tensorflow.metadata.v0.SparseFeature.ValueFeature value_feature = 9;
        Specified by:
        hasValueFeature in interface SparseFeatureOrBuilder
        Returns:
        Whether the valueFeature field is set.
      • hasType

        @Deprecated
        public boolean hasType()
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Specified by:
        hasType in interface SparseFeatureOrBuilder
        Returns:
        Whether the type field is set.
      • getType

        @Deprecated
        public FeatureType getType()
        Deprecated.
         Type of value feature.
         Deprecated, this is inferred by the referred features.
         
        optional .tensorflow.metadata.v0.FeatureType type = 10 [deprecated = true];
        Specified by:
        getType in interface SparseFeatureOrBuilder
        Returns:
        The type.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static SparseFeature parseFrom​(ByteBuffer data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(ByteBuffer data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(com.google.protobuf.ByteString data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(com.google.protobuf.ByteString data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(byte[] data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(byte[] data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static SparseFeature parseFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Throws:
        IOException
      • newBuilderForType

        public SparseFeature.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public SparseFeature.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected SparseFeature.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static SparseFeature getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<SparseFeature> parser()
      • getParserForType

        public com.google.protobuf.Parser<SparseFeature> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public SparseFeature getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder