private long[] shapeFromShapeProto(TensorShapeProto tensorShapeProto) { long[] shape = new long[tensorShapeProto.getDimList().size()]; for(int i = 0; i < shape.length; i++) { shape[i] = tensorShapeProto.getDim(i).getSize(); } //shape should be mapped to a row vector if(shape.length < 2) { if(shape.length == 1) shape = new long[]{1,shape[0]}; else shape = new long[]{1,1}; } return shape; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.tensorflow.framework.TensorShapeProto)) { return super.equals(obj); } org.tensorflow.framework.TensorShapeProto other = (org.tensorflow.framework.TensorShapeProto) obj; boolean result = true; result = result && getDimList() .equals(other.getDimList()); result = result && (getUnknownRank() == other.getUnknownRank()); 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 (getDimCount() > 0) { hash = (37 * hash) + DIM_FIELD_NUMBER; hash = (53 * hash) + getDimList().hashCode(); } hash = (37 * hash) + UNKNOWN_RANK_FIELD_NUMBER; hash = (53 * hash) + com.github.os72.protobuf351.Internal.hashBoolean( getUnknownRank()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
break; case SHAPE: val shape = attr.getShape().getDimList(); int[] dimsToSet = new int[shape.size()]; for(int i = 0; i < dimsToSet.length; i++) {
this.shape = shapeRet; } else { val shapeVals = shape.getShape().getDimList(); if (shapeVals.size() > 1) { this.shape = new long[shapeVals.size()];
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.tensorflow.framework.TensorShapeProto)) { return super.equals(obj); } org.tensorflow.framework.TensorShapeProto other = (org.tensorflow.framework.TensorShapeProto) obj; boolean result = true; result = result && getDimList() .equals(other.getDimList()); result = result && (getUnknownRank() == other.getUnknownRank()); 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 (getDimCount() > 0) { hash = (37 * hash) + DIM_FIELD_NUMBER; hash = (53 * hash) + getDimList().hashCode(); } hash = (37 * hash) + UNKNOWN_RANK_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getUnknownRank()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }