Class KernelDef.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<KernelDef.Builder>
com.google.protobuf.GeneratedMessage.Builder<KernelDef.Builder>
org.tensorflow.proto.KernelDef.Builder
- All Implemented Interfaces:
Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, Cloneable, KernelDefOrBuilder
- Enclosing class:
KernelDef
public static final class KernelDef.Builder
extends GeneratedMessage.Builder<KernelDef.Builder>
implements KernelDefOrBuilder
Protobuf type
tensorflow.KernelDef-
Method Summary
Modifier and TypeMethodDescriptionaddAllConstraint(Iterable<? extends KernelDef.AttrConstraint> values) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;addAllHostMemoryArg(Iterable<String> values) Names of the Op's input_/output_args that reside in host memory instead of device memory.addConstraint(int index, KernelDef.AttrConstraint value) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;addConstraint(int index, KernelDef.AttrConstraint.Builder builderForValue) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;addConstraint(KernelDef.AttrConstraint.Builder builderForValue) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;addConstraintBuilder(int index) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;addHostMemoryArg(String value) Names of the Op's input_/output_args that reside in host memory instead of device memory.addHostMemoryArgBytes(ByteString value) Names of the Op's input_/output_args that reside in host memory instead of device memory.build()clear()repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;Type of device this kernel runs on.Names of the Op's input_/output_args that reside in host memory instead of device memory.This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.clearOp()Must match the name of an Op.Prioritization of kernel amongst different devices.getConstraint(int index) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;getConstraintBuilder(int index) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;intrepeated .tensorflow.KernelDef.AttrConstraint constraint = 3;repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;getConstraintOrBuilder(int index) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;List<? extends KernelDef.AttrConstraintOrBuilder> repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;static final Descriptors.DescriptorType of device this kernel runs on.Type of device this kernel runs on.getHostMemoryArg(int index) Names of the Op's input_/output_args that reside in host memory instead of device memory.getHostMemoryArgBytes(int index) Names of the Op's input_/output_args that reside in host memory instead of device memory.intNames of the Op's input_/output_args that reside in host memory instead of device memory.Names of the Op's input_/output_args that reside in host memory instead of device memory.getLabel()This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.getOp()Must match the name of an Op.Must match the name of an Op.intPrioritization of kernel amongst different devices.protected GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) removeConstraint(int index) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;setConstraint(int index, KernelDef.AttrConstraint value) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;setConstraint(int index, KernelDef.AttrConstraint.Builder builderForValue) repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;setDeviceType(String value) Type of device this kernel runs on.setDeviceTypeBytes(ByteString value) Type of device this kernel runs on.setHostMemoryArg(int index, String value) Names of the Op's input_/output_args that reside in host memory instead of device memory.This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.setLabelBytes(ByteString value) This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.Must match the name of an Op.setOpBytes(ByteString value) Must match the name of an Op.setPriority(int value) Prioritization of kernel amongst different devices.Methods inherited from class GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
-
Method Details
-
getDescriptor
-
internalGetFieldAccessorTable
- Specified by:
internalGetFieldAccessorTablein classGeneratedMessage.Builder<KernelDef.Builder>
-
clear
- Specified by:
clearin interfaceMessage.Builder- Specified by:
clearin interfaceMessageLite.Builder- Overrides:
clearin classGeneratedMessage.Builder<KernelDef.Builder>
-
getDescriptorForType
- Specified by:
getDescriptorForTypein interfaceMessage.Builder- Specified by:
getDescriptorForTypein interfaceMessageOrBuilder- Overrides:
getDescriptorForTypein classGeneratedMessage.Builder<KernelDef.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfaceMessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceMessageOrBuilder
-
build
- Specified by:
buildin interfaceMessage.Builder- Specified by:
buildin interfaceMessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfaceMessage.Builder- Specified by:
buildPartialin interfaceMessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfaceMessage.Builder- Overrides:
mergeFromin classAbstractMessage.Builder<KernelDef.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfaceMessageLiteOrBuilder- Overrides:
isInitializedin classGeneratedMessage.Builder<KernelDef.Builder>
-
mergeFrom
public KernelDef.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfaceMessage.Builder- Specified by:
mergeFromin interfaceMessageLite.Builder- Overrides:
mergeFromin classAbstractMessage.Builder<KernelDef.Builder>- Throws:
IOException
-
getOp
Must match the name of an Op.
string op = 1;- Specified by:
getOpin interfaceKernelDefOrBuilder- Returns:
- The op.
-
getOpBytes
Must match the name of an Op.
string op = 1;- Specified by:
getOpBytesin interfaceKernelDefOrBuilder- Returns:
- The bytes for op.
-
setOp
Must match the name of an Op.
string op = 1;- Parameters:
value- The op to set.- Returns:
- This builder for chaining.
-
clearOp
Must match the name of an Op.
string op = 1;- Returns:
- This builder for chaining.
-
setOpBytes
Must match the name of an Op.
string op = 1;- Parameters:
value- The bytes for op to set.- Returns:
- This builder for chaining.
-
getDeviceType
Type of device this kernel runs on.
string device_type = 2;- Specified by:
getDeviceTypein interfaceKernelDefOrBuilder- Returns:
- The deviceType.
-
getDeviceTypeBytes
Type of device this kernel runs on.
string device_type = 2;- Specified by:
getDeviceTypeBytesin interfaceKernelDefOrBuilder- Returns:
- The bytes for deviceType.
-
setDeviceType
Type of device this kernel runs on.
string device_type = 2;- Parameters:
value- The deviceType to set.- Returns:
- This builder for chaining.
-
clearDeviceType
Type of device this kernel runs on.
string device_type = 2;- Returns:
- This builder for chaining.
-
setDeviceTypeBytes
Type of device this kernel runs on.
string device_type = 2;- Parameters:
value- The bytes for deviceType to set.- Returns:
- This builder for chaining.
-
getConstraintList
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;- Specified by:
getConstraintListin interfaceKernelDefOrBuilder
-
getConstraintCount
public int getConstraintCount()repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;- Specified by:
getConstraintCountin interfaceKernelDefOrBuilder
-
getConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;- Specified by:
getConstraintin interfaceKernelDefOrBuilder
-
setConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
setConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addAllConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
clearConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
removeConstraint
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
getConstraintBuilder
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
getConstraintOrBuilder
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;- Specified by:
getConstraintOrBuilderin interfaceKernelDefOrBuilder
-
getConstraintOrBuilderList
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;- Specified by:
getConstraintOrBuilderListin interfaceKernelDefOrBuilder
-
addConstraintBuilder
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
addConstraintBuilder
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
getConstraintBuilderList
repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; -
getHostMemoryArgList
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Specified by:
getHostMemoryArgListin interfaceKernelDefOrBuilder- Returns:
- A list containing the hostMemoryArg.
-
getHostMemoryArgCount
public int getHostMemoryArgCount()Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Specified by:
getHostMemoryArgCountin interfaceKernelDefOrBuilder- Returns:
- The count of hostMemoryArg.
-
getHostMemoryArg
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Specified by:
getHostMemoryArgin interfaceKernelDefOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The hostMemoryArg at the given index.
-
getHostMemoryArgBytes
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Specified by:
getHostMemoryArgBytesin interfaceKernelDefOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the hostMemoryArg at the given index.
-
setHostMemoryArg
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Parameters:
index- The index to set the value at.value- The hostMemoryArg to set.- Returns:
- This builder for chaining.
-
addHostMemoryArg
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Parameters:
value- The hostMemoryArg to add.- Returns:
- This builder for chaining.
-
addAllHostMemoryArg
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Parameters:
values- The hostMemoryArg to add.- Returns:
- This builder for chaining.
-
clearHostMemoryArg
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Returns:
- This builder for chaining.
-
addHostMemoryArgBytes
Names of the Op's input_/output_args that reside in host memory instead of device memory.
repeated string host_memory_arg = 4;- Parameters:
value- The bytes of the hostMemoryArg to add.- Returns:
- This builder for chaining.
-
getLabel
This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.
string label = 5;- Specified by:
getLabelin interfaceKernelDefOrBuilder- Returns:
- The label.
-
getLabelBytes
This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.
string label = 5;- Specified by:
getLabelBytesin interfaceKernelDefOrBuilder- Returns:
- The bytes for label.
-
setLabel
This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.
string label = 5;- Parameters:
value- The label to set.- Returns:
- This builder for chaining.
-
clearLabel
This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.
string label = 5;- Returns:
- This builder for chaining.
-
setLabelBytes
This allows experimental kernels to be registered for an op that won't be used unless the user specifies a "_kernel" attr with value matching this.
string label = 5;- Parameters:
value- The bytes for label to set.- Returns:
- This builder for chaining.
-
getPriority
public int getPriority()Prioritization of kernel amongst different devices. By default we assume priority is 0. The higher the priority the better. By default (i.e. if this is not set), we prefer GPU kernels over CPU.
int32 priority = 6;- Specified by:
getPriorityin interfaceKernelDefOrBuilder- Returns:
- The priority.
-
setPriority
Prioritization of kernel amongst different devices. By default we assume priority is 0. The higher the priority the better. By default (i.e. if this is not set), we prefer GPU kernels over CPU.
int32 priority = 6;- Parameters:
value- The priority to set.- Returns:
- This builder for chaining.
-
clearPriority
Prioritization of kernel amongst different devices. By default we assume priority is 0. The higher the priority the better. By default (i.e. if this is not set), we prefer GPU kernels over CPU.
int32 priority = 6;- Returns:
- This builder for chaining.
-