public org.tensorflow.framework.TensorProto buildPartial() { org.tensorflow.framework.TensorProto result = new org.tensorflow.framework.TensorProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + DTYPE_FIELD_NUMBER; hash = (53 * hash) + dtype_; if (hasTensorShape()) { hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; hash = (53 * hash) + getTensorShape().hashCode(); hash = (53 * hash) + getVersionNumber(); hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; hash = (53 * hash) + getTensorContent().hashCode(); if (getHalfValCount() > 0) { hash = (37 * hash) + HALF_VAL_FIELD_NUMBER; hash = (53 * hash) + getHalfValList().hashCode(); if (getFloatValCount() > 0) { hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; hash = (53 * hash) + getFloatValList().hashCode(); if (getDoubleValCount() > 0) { hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; hash = (53 * hash) + getDoubleValList().hashCode(); if (getIntValCount() > 0) { hash = (37 * hash) + INT_VAL_FIELD_NUMBER; hash = (53 * hash) + getIntValList().hashCode(); if (getStringValCount() > 0) { hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; hash = (53 * hash) + getStringValList().hashCode();
/** * <code>.tensorflow.TensorProto tensor = 8;</code> */ public org.tensorflow.framework.TensorProtoOrBuilder getTensorOrBuilder() { if (valueCase_ == 8) { return (org.tensorflow.framework.TensorProto) value_; } return org.tensorflow.framework.TensorProto.getDefaultInstance(); }
/** * <pre> * Serialized raw tensor content from either Tensor::AsProtoTensorContent or * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation * can be used for all tensor types. The purpose of this representation is to * reduce serialization overhead during RPC call by avoiding serialization of * many repeated small items. * </pre> * * <code>bytes tensor_content = 4;</code> */ public Builder clearTensorContent() { tensorContent_ = getDefaultInstance().getTensorContent(); onChanged(); return this; }
result = result && (hasTensorShape() == other.hasTensorShape()); if (hasTensorShape()) { result = result && getTensorShape() .equals(other.getTensorShape()); result = result && (getVersionNumber() == other.getVersionNumber()); result = result && getTensorContent() .equals(other.getTensorContent()); result = result && getHalfValList() .equals(other.getHalfValList()); result = result && getFloatValList() .equals(other.getFloatValList()); result = result && getDoubleValList() .equals(other.getDoubleValList()); result = result && getIntValList() .equals(other.getIntValList()); result = result && getStringValList() .equals(other.getStringValList()); result = result && getScomplexValList() .equals(other.getScomplexValList()); result = result && getInt64ValList() .equals(other.getInt64ValList()); result = result && getBoolValList() .equals(other.getBoolValList()); result = result && getDcomplexValList() .equals(other.getDcomplexValList()); result = result && getResourceHandleValList() .equals(other.getResourceHandleValList());
.computeMessageSize(2, getTensorShape()); dataSize = 4 * getFloatValList().size(); size += dataSize; if (!getFloatValList().isEmpty()) { size += 1; size += com.github.os72.protobuf351.CodedOutputStream dataSize = 8 * getDoubleValList().size(); size += dataSize; if (!getDoubleValList().isEmpty()) { size += 1; size += com.github.os72.protobuf351.CodedOutputStream if (!getIntValList().isEmpty()) { size += 1; size += com.github.os72.protobuf351.CodedOutputStream size += 1 * getStringValList().size(); dataSize = 4 * getScomplexValList().size(); size += dataSize; if (!getScomplexValList().isEmpty()) { size += 1; size += com.github.os72.protobuf351.CodedOutputStream if (!getInt64ValList().isEmpty()) { size += 1; size += com.github.os72.protobuf351.CodedOutputStream
int dims = tfTensor.getTensorShape().getDimCount(); int[] arrayShape = null; List<Integer> dimensions = new ArrayList<>(); int dim = (int) tfTensor.getTensorShape().getDim(e).getSize(); if (tfTensor.getDtype() == DataType.DT_INT32 || tfTensor.getDtype() == DataType.DT_INT16 || tfTensor.getDtype() == DataType.DT_INT8) { if (tfTensor.getIntValCount() == 1 || ArrayUtil.prod(arrayShape) == 1) { if(tfTensor.getIntValCount() < 1) return Nd4j.trueScalar(0.0); int val = tfTensor.getIntVal(0); } else if (tfTensor.getInt64ValCount() > 0) { double[] jArray = new double[tfTensor.getIntValCount()]; for (int e = 0; e < tfTensor.getIntValCount(); e++) { jArray[e] = (double) tfTensor.getIntVal(e); val bb = tfTensor.getTensorContent().asReadOnlyByteBuffer(); val fb = bb.order(ByteOrder.nativeOrder()).asIntBuffer(); val fa = new float[fb.capacity()]; } else if (tfTensor.getDtype() == DataType.DT_FLOAT) { if (tfTensor.getFloatValCount() == 1 || ArrayUtil.prod(arrayShape) == 1) { if(tfTensor.getFloatValCount() < 1) return Nd4j.scalar(0.0);
public Builder mergeFrom(org.tensorflow.framework.TensorProto other) { if (other == org.tensorflow.framework.TensorProto.getDefaultInstance()) return this; if (other.dtype_ != 0) { setDtypeValue(other.getDtypeValue()); if (other.hasTensorShape()) { mergeTensorShape(other.getTensorShape()); if (other.getVersionNumber() != 0) { setVersionNumber(other.getVersionNumber()); if (other.getTensorContent() != com.github.os72.protobuf351.ByteString.EMPTY) { setTensorContent(other.getTensorContent());
/** * <code>.tensorflow.TensorProto tensor = 8;</code> */ public Builder mergeTensor(org.tensorflow.framework.TensorProto value) { if (tensorBuilder_ == null) { if (valueCase_ == 8 && value_ != org.tensorflow.framework.TensorProto.getDefaultInstance()) { value_ = org.tensorflow.framework.TensorProto.newBuilder((org.tensorflow.framework.TensorProto) value_) .mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 8) { tensorBuilder_.mergeFrom(value); } tensorBuilder_.setMessage(value); } valueCase_ = 8; return this; } /**
case 8: result = result && getTensor() .equals(other.getTensor()); break; case 0:
result = result && (hasTensorShape() == other.hasTensorShape()); if (hasTensorShape()) { result = result && getTensorShape() .equals(other.getTensorShape()); result = result && (getVersionNumber() == other.getVersionNumber()); result = result && getTensorContent() .equals(other.getTensorContent()); result = result && getHalfValList() .equals(other.getHalfValList()); result = result && getFloatValList() .equals(other.getFloatValList()); result = result && getDoubleValList() .equals(other.getDoubleValList()); result = result && getIntValList() .equals(other.getIntValList()); result = result && getStringValList() .equals(other.getStringValList()); result = result && getScomplexValList() .equals(other.getScomplexValList()); result = result && getInt64ValList() .equals(other.getInt64ValList()); result = result && getBoolValList() .equals(other.getBoolValList()); result = result && getDcomplexValList() .equals(other.getDcomplexValList()); result = result && getResourceHandleValList() .equals(other.getResourceHandleValList());
public void writeTo(com.github.os72.protobuf351.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (dtype_ != org.tensorflow.framework.DataType.DT_INVALID.getNumber()) { output.writeEnum(1, dtype_); output.writeMessage(2, getTensorShape()); if (getFloatValList().size() > 0) { output.writeUInt32NoTag(42); output.writeUInt32NoTag(floatValMemoizedSerializedSize); if (getDoubleValList().size() > 0) { output.writeUInt32NoTag(50); output.writeUInt32NoTag(doubleValMemoizedSerializedSize); if (getIntValList().size() > 0) { output.writeUInt32NoTag(58); output.writeUInt32NoTag(intValMemoizedSerializedSize); if (getScomplexValList().size() > 0) { output.writeUInt32NoTag(74); output.writeUInt32NoTag(scomplexValMemoizedSerializedSize); if (getInt64ValList().size() > 0) { output.writeUInt32NoTag(82); output.writeUInt32NoTag(int64ValMemoizedSerializedSize); if (getBoolValList().size() > 0) { output.writeUInt32NoTag(90);
public Builder mergeFrom(org.tensorflow.framework.TensorProto other) { if (other == org.tensorflow.framework.TensorProto.getDefaultInstance()) return this; if (other.dtype_ != 0) { setDtypeValue(other.getDtypeValue()); if (other.hasTensorShape()) { mergeTensorShape(other.getTensorShape()); if (other.getVersionNumber() != 0) { setVersionNumber(other.getVersionNumber()); if (other.getTensorContent() != com.google.protobuf.ByteString.EMPTY) { setTensorContent(other.getTensorContent());
/** * <pre> * "tensor" * </pre> * * <code>.tensorflow.TensorProto tensor = 8;</code> */ public Builder mergeTensor(org.tensorflow.framework.TensorProto value) { if (tensorBuilder_ == null) { if (valueCase_ == 8 && value_ != org.tensorflow.framework.TensorProto.getDefaultInstance()) { value_ = org.tensorflow.framework.TensorProto.newBuilder((org.tensorflow.framework.TensorProto) value_) .mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 8) { tensorBuilder_.mergeFrom(value); } tensorBuilder_.setMessage(value); } valueCase_ = 8; return this; } /**
/** * <pre> * Serialized raw tensor content from either Tensor::AsProtoTensorContent or * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation * can be used for all tensor types. The purpose of this representation is to * reduce serialization overhead during RPC call by avoiding serialization of * many repeated small items. * </pre> * * <code>bytes tensor_content = 4;</code> */ public Builder clearTensorContent() { tensorContent_ = getDefaultInstance().getTensorContent(); onChanged(); return this; }
case 8: result = result && getTensor() .equals(other.getTensor()); break; case 1:
hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + DTYPE_FIELD_NUMBER; hash = (53 * hash) + dtype_; if (hasTensorShape()) { hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; hash = (53 * hash) + getTensorShape().hashCode(); hash = (53 * hash) + getVersionNumber(); hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; hash = (53 * hash) + getTensorContent().hashCode(); if (getHalfValCount() > 0) { hash = (37 * hash) + HALF_VAL_FIELD_NUMBER; hash = (53 * hash) + getHalfValList().hashCode(); if (getFloatValCount() > 0) { hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; hash = (53 * hash) + getFloatValList().hashCode(); if (getDoubleValCount() > 0) { hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; hash = (53 * hash) + getDoubleValList().hashCode(); if (getIntValCount() > 0) { hash = (37 * hash) + INT_VAL_FIELD_NUMBER; hash = (53 * hash) + getIntValList().hashCode(); if (getStringValCount() > 0) { hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; hash = (53 * hash) + getStringValList().hashCode();
.computeMessageSize(2, getTensorShape()); dataSize = 4 * getFloatValList().size(); size += dataSize; if (!getFloatValList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream dataSize = 8 * getDoubleValList().size(); size += dataSize; if (!getDoubleValList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream if (!getIntValList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream size += 1 * getStringValList().size(); dataSize = 4 * getScomplexValList().size(); size += dataSize; if (!getScomplexValList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream if (!getInt64ValList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream
/** * <pre> * "tensor" * </pre> * * <code>.tensorflow.TensorProto tensor = 8;</code> */ public org.tensorflow.framework.TensorProtoOrBuilder getTensorOrBuilder() { if (valueCase_ == 8) { return (org.tensorflow.framework.TensorProto) value_; } return org.tensorflow.framework.TensorProto.getDefaultInstance(); }
/** * <code>.tensorflow.TensorProto tensor = 8;</code> */ public Builder mergeTensor(org.tensorflow.framework.TensorProto value) { if (tensorBuilder_ == null) { if (valueCase_ == 8 && value_ != org.tensorflow.framework.TensorProto.getDefaultInstance()) { value_ = org.tensorflow.framework.TensorProto.newBuilder((org.tensorflow.framework.TensorProto) value_) .mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 8) { tensorBuilder_.mergeFrom(value); } tensorBuilder_.setMessage(value); } valueCase_ = 8; return this; } /**