
tensorflow.tpu.Topology Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/contrib/tpu/proto/topology.proto
package tensorflow.tpu;
public final class Topology {
private Topology() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface TopologyProtoOrBuilder extends
// @@protoc_insertion_point(interface_extends:tensorflow.tpu.TopologyProto)
com.google.protobuf.MessageOrBuilder {
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
java.util.List getMeshShapeList();
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
int getMeshShapeCount();
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
int getMeshShape(int index);
/**
*
* Number of TensorFlow tasks in the cluster.
*
*
* int32 num_tasks = 2;
*/
int getNumTasks();
/**
*
* Number of TPU devices per task.
*
*
* int32 num_tpu_devices_per_task = 3;
*/
int getNumTpuDevicesPerTask();
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
java.util.List getDeviceCoordinatesList();
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
int getDeviceCoordinatesCount();
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
int getDeviceCoordinates(int index);
}
/**
*
* Describes the geometry of a TPU mesh.
*
*
* Protobuf type {@code tensorflow.tpu.TopologyProto}
*/
public static final class TopologyProto extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.tpu.TopologyProto)
TopologyProtoOrBuilder {
private static final long serialVersionUID = 0L;
// Use TopologyProto.newBuilder() to construct.
private TopologyProto(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TopologyProto() {
meshShape_ = java.util.Collections.emptyList();
numTasks_ = 0;
numTpuDevicesPerTask_ = 0;
deviceCoordinates_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TopologyProto(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
meshShape_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
meshShape_.add(input.readInt32());
break;
}
case 10: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
meshShape_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
meshShape_.add(input.readInt32());
}
input.popLimit(limit);
break;
}
case 16: {
numTasks_ = input.readInt32();
break;
}
case 24: {
numTpuDevicesPerTask_ = input.readInt32();
break;
}
case 32: {
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
deviceCoordinates_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000008;
}
deviceCoordinates_.add(input.readInt32());
break;
}
case 34: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
deviceCoordinates_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000008;
}
while (input.getBytesUntilLimit() > 0) {
deviceCoordinates_.add(input.readInt32());
}
input.popLimit(limit);
break;
}
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
meshShape_ = java.util.Collections.unmodifiableList(meshShape_);
}
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
deviceCoordinates_ = java.util.Collections.unmodifiableList(deviceCoordinates_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tensorflow.tpu.Topology.internal_static_tensorflow_tpu_TopologyProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tensorflow.tpu.Topology.internal_static_tensorflow_tpu_TopologyProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tensorflow.tpu.Topology.TopologyProto.class, tensorflow.tpu.Topology.TopologyProto.Builder.class);
}
private int bitField0_;
public static final int MESH_SHAPE_FIELD_NUMBER = 1;
private java.util.List meshShape_;
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public java.util.List
getMeshShapeList() {
return meshShape_;
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public int getMeshShapeCount() {
return meshShape_.size();
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public int getMeshShape(int index) {
return meshShape_.get(index);
}
private int meshShapeMemoizedSerializedSize = -1;
public static final int NUM_TASKS_FIELD_NUMBER = 2;
private int numTasks_;
/**
*
* Number of TensorFlow tasks in the cluster.
*
*
* int32 num_tasks = 2;
*/
public int getNumTasks() {
return numTasks_;
}
public static final int NUM_TPU_DEVICES_PER_TASK_FIELD_NUMBER = 3;
private int numTpuDevicesPerTask_;
/**
*
* Number of TPU devices per task.
*
*
* int32 num_tpu_devices_per_task = 3;
*/
public int getNumTpuDevicesPerTask() {
return numTpuDevicesPerTask_;
}
public static final int DEVICE_COORDINATES_FIELD_NUMBER = 4;
private java.util.List deviceCoordinates_;
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public java.util.List
getDeviceCoordinatesList() {
return deviceCoordinates_;
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public int getDeviceCoordinatesCount() {
return deviceCoordinates_.size();
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public int getDeviceCoordinates(int index) {
return deviceCoordinates_.get(index);
}
private int deviceCoordinatesMemoizedSerializedSize = -1;
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (getMeshShapeList().size() > 0) {
output.writeUInt32NoTag(10);
output.writeUInt32NoTag(meshShapeMemoizedSerializedSize);
}
for (int i = 0; i < meshShape_.size(); i++) {
output.writeInt32NoTag(meshShape_.get(i));
}
if (numTasks_ != 0) {
output.writeInt32(2, numTasks_);
}
if (numTpuDevicesPerTask_ != 0) {
output.writeInt32(3, numTpuDevicesPerTask_);
}
if (getDeviceCoordinatesList().size() > 0) {
output.writeUInt32NoTag(34);
output.writeUInt32NoTag(deviceCoordinatesMemoizedSerializedSize);
}
for (int i = 0; i < deviceCoordinates_.size(); i++) {
output.writeInt32NoTag(deviceCoordinates_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < meshShape_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(meshShape_.get(i));
}
size += dataSize;
if (!getMeshShapeList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
meshShapeMemoizedSerializedSize = dataSize;
}
if (numTasks_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, numTasks_);
}
if (numTpuDevicesPerTask_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, numTpuDevicesPerTask_);
}
{
int dataSize = 0;
for (int i = 0; i < deviceCoordinates_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(deviceCoordinates_.get(i));
}
size += dataSize;
if (!getDeviceCoordinatesList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
deviceCoordinatesMemoizedSerializedSize = dataSize;
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof tensorflow.tpu.Topology.TopologyProto)) {
return super.equals(obj);
}
tensorflow.tpu.Topology.TopologyProto other = (tensorflow.tpu.Topology.TopologyProto) obj;
boolean result = true;
result = result && getMeshShapeList()
.equals(other.getMeshShapeList());
result = result && (getNumTasks()
== other.getNumTasks());
result = result && (getNumTpuDevicesPerTask()
== other.getNumTpuDevicesPerTask());
result = result && getDeviceCoordinatesList()
.equals(other.getDeviceCoordinatesList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getMeshShapeCount() > 0) {
hash = (37 * hash) + MESH_SHAPE_FIELD_NUMBER;
hash = (53 * hash) + getMeshShapeList().hashCode();
}
hash = (37 * hash) + NUM_TASKS_FIELD_NUMBER;
hash = (53 * hash) + getNumTasks();
hash = (37 * hash) + NUM_TPU_DEVICES_PER_TASK_FIELD_NUMBER;
hash = (53 * hash) + getNumTpuDevicesPerTask();
if (getDeviceCoordinatesCount() > 0) {
hash = (37 * hash) + DEVICE_COORDINATES_FIELD_NUMBER;
hash = (53 * hash) + getDeviceCoordinatesList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static tensorflow.tpu.Topology.TopologyProto parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static tensorflow.tpu.Topology.TopologyProto parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static tensorflow.tpu.Topology.TopologyProto parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(tensorflow.tpu.Topology.TopologyProto prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Describes the geometry of a TPU mesh.
*
*
* Protobuf type {@code tensorflow.tpu.TopologyProto}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tensorflow.tpu.TopologyProto)
tensorflow.tpu.Topology.TopologyProtoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return tensorflow.tpu.Topology.internal_static_tensorflow_tpu_TopologyProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return tensorflow.tpu.Topology.internal_static_tensorflow_tpu_TopologyProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
tensorflow.tpu.Topology.TopologyProto.class, tensorflow.tpu.Topology.TopologyProto.Builder.class);
}
// Construct using tensorflow.tpu.Topology.TopologyProto.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
meshShape_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
numTasks_ = 0;
numTpuDevicesPerTask_ = 0;
deviceCoordinates_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return tensorflow.tpu.Topology.internal_static_tensorflow_tpu_TopologyProto_descriptor;
}
@java.lang.Override
public tensorflow.tpu.Topology.TopologyProto getDefaultInstanceForType() {
return tensorflow.tpu.Topology.TopologyProto.getDefaultInstance();
}
@java.lang.Override
public tensorflow.tpu.Topology.TopologyProto build() {
tensorflow.tpu.Topology.TopologyProto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public tensorflow.tpu.Topology.TopologyProto buildPartial() {
tensorflow.tpu.Topology.TopologyProto result = new tensorflow.tpu.Topology.TopologyProto(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
meshShape_ = java.util.Collections.unmodifiableList(meshShape_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.meshShape_ = meshShape_;
result.numTasks_ = numTasks_;
result.numTpuDevicesPerTask_ = numTpuDevicesPerTask_;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
deviceCoordinates_ = java.util.Collections.unmodifiableList(deviceCoordinates_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.deviceCoordinates_ = deviceCoordinates_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof tensorflow.tpu.Topology.TopologyProto) {
return mergeFrom((tensorflow.tpu.Topology.TopologyProto)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(tensorflow.tpu.Topology.TopologyProto other) {
if (other == tensorflow.tpu.Topology.TopologyProto.getDefaultInstance()) return this;
if (!other.meshShape_.isEmpty()) {
if (meshShape_.isEmpty()) {
meshShape_ = other.meshShape_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureMeshShapeIsMutable();
meshShape_.addAll(other.meshShape_);
}
onChanged();
}
if (other.getNumTasks() != 0) {
setNumTasks(other.getNumTasks());
}
if (other.getNumTpuDevicesPerTask() != 0) {
setNumTpuDevicesPerTask(other.getNumTpuDevicesPerTask());
}
if (!other.deviceCoordinates_.isEmpty()) {
if (deviceCoordinates_.isEmpty()) {
deviceCoordinates_ = other.deviceCoordinates_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureDeviceCoordinatesIsMutable();
deviceCoordinates_.addAll(other.deviceCoordinates_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
tensorflow.tpu.Topology.TopologyProto parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (tensorflow.tpu.Topology.TopologyProto) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List meshShape_ = java.util.Collections.emptyList();
private void ensureMeshShapeIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
meshShape_ = new java.util.ArrayList(meshShape_);
bitField0_ |= 0x00000001;
}
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public java.util.List
getMeshShapeList() {
return java.util.Collections.unmodifiableList(meshShape_);
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public int getMeshShapeCount() {
return meshShape_.size();
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public int getMeshShape(int index) {
return meshShape_.get(index);
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public Builder setMeshShape(
int index, int value) {
ensureMeshShapeIsMutable();
meshShape_.set(index, value);
onChanged();
return this;
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public Builder addMeshShape(int value) {
ensureMeshShapeIsMutable();
meshShape_.add(value);
onChanged();
return this;
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public Builder addAllMeshShape(
java.lang.Iterable extends java.lang.Integer> values) {
ensureMeshShapeIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, meshShape_);
onChanged();
return this;
}
/**
*
* The dimensions of the TPU topology, in cores. Typically, this is a 3D
* topology [x, y, core], where the major dimensions correspond to TPU chips,
* and the minor dimension describes the number of cores on a multicore chip.
*
*
* repeated int32 mesh_shape = 1;
*/
public Builder clearMeshShape() {
meshShape_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private int numTasks_ ;
/**
*
* Number of TensorFlow tasks in the cluster.
*
*
* int32 num_tasks = 2;
*/
public int getNumTasks() {
return numTasks_;
}
/**
*
* Number of TensorFlow tasks in the cluster.
*
*
* int32 num_tasks = 2;
*/
public Builder setNumTasks(int value) {
numTasks_ = value;
onChanged();
return this;
}
/**
*
* Number of TensorFlow tasks in the cluster.
*
*
* int32 num_tasks = 2;
*/
public Builder clearNumTasks() {
numTasks_ = 0;
onChanged();
return this;
}
private int numTpuDevicesPerTask_ ;
/**
*
* Number of TPU devices per task.
*
*
* int32 num_tpu_devices_per_task = 3;
*/
public int getNumTpuDevicesPerTask() {
return numTpuDevicesPerTask_;
}
/**
*
* Number of TPU devices per task.
*
*
* int32 num_tpu_devices_per_task = 3;
*/
public Builder setNumTpuDevicesPerTask(int value) {
numTpuDevicesPerTask_ = value;
onChanged();
return this;
}
/**
*
* Number of TPU devices per task.
*
*
* int32 num_tpu_devices_per_task = 3;
*/
public Builder clearNumTpuDevicesPerTask() {
numTpuDevicesPerTask_ = 0;
onChanged();
return this;
}
private java.util.List deviceCoordinates_ = java.util.Collections.emptyList();
private void ensureDeviceCoordinatesIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
deviceCoordinates_ = new java.util.ArrayList(deviceCoordinates_);
bitField0_ |= 0x00000008;
}
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public java.util.List
getDeviceCoordinatesList() {
return java.util.Collections.unmodifiableList(deviceCoordinates_);
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public int getDeviceCoordinatesCount() {
return deviceCoordinates_.size();
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public int getDeviceCoordinates(int index) {
return deviceCoordinates_.get(index);
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public Builder setDeviceCoordinates(
int index, int value) {
ensureDeviceCoordinatesIsMutable();
deviceCoordinates_.set(index, value);
onChanged();
return this;
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public Builder addDeviceCoordinates(int value) {
ensureDeviceCoordinatesIsMutable();
deviceCoordinates_.add(value);
onChanged();
return this;
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public Builder addAllDeviceCoordinates(
java.lang.Iterable extends java.lang.Integer> values) {
ensureDeviceCoordinatesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, deviceCoordinates_);
onChanged();
return this;
}
/**
*
* A flattened rank 3 int32 array with shape
* [num_tasks, num_tpu_devices_per_task, len(mesh_shape)].
* `tasks` is the number of tasks in the TPU cluster, `devices` is the number
* of TPU devices per task, and the minor dimension corresponds to a position
* in the TPU mesh topology. Each entry [task, device, axis] gives the
* `axis`-th coordinate in the topology of a task/device pair.
*
*
* repeated int32 device_coordinates = 4;
*/
public Builder clearDeviceCoordinates() {
deviceCoordinates_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:tensorflow.tpu.TopologyProto)
}
// @@protoc_insertion_point(class_scope:tensorflow.tpu.TopologyProto)
private static final tensorflow.tpu.Topology.TopologyProto DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new tensorflow.tpu.Topology.TopologyProto();
}
public static tensorflow.tpu.Topology.TopologyProto getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TopologyProto parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TopologyProto(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public tensorflow.tpu.Topology.TopologyProto getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_tensorflow_tpu_TopologyProto_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_tensorflow_tpu_TopologyProto_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n+tensorflow/contrib/tpu/proto/topology." +
"proto\022\016tensorflow.tpu\"t\n\rTopologyProto\022\022" +
"\n\nmesh_shape\030\001 \003(\005\022\021\n\tnum_tasks\030\002 \001(\005\022 \n" +
"\030num_tpu_devices_per_task\030\003 \001(\005\022\032\n\022devic" +
"e_coordinates\030\004 \003(\005B\003\370\001\001b\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_tensorflow_tpu_TopologyProto_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_tensorflow_tpu_TopologyProto_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_tensorflow_tpu_TopologyProto_descriptor,
new java.lang.String[] { "MeshShape", "NumTasks", "NumTpuDevicesPerTask", "DeviceCoordinates", });
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy