Skip to content

Commit

Permalink
remove HalfPrecisionConversion。
Browse files Browse the repository at this point in the history
  • Loading branch information
ouyangwen-it committed Jun 11, 2021
1 parent f5f20c9 commit ff3ed83
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*.class
angel-ps/core/target/
angel-ps/psf/target/
angel-ps/graph/
angel-ps/graph/target/
angel-ps/examples/target/
angel-ps/jarvis/target/
angel-ps/tools/target/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package com.tencent.angel.graph.data;

import com.tencent.angel.graph.utils.HalfPrecisionConversion;
import com.tencent.angel.ml.math2.VFactory;
import com.tencent.angel.ml.math2.vector.IntFloatVector;
import com.tencent.angel.ps.storage.vector.storage.StorageMethod;
Expand Down Expand Up @@ -204,17 +203,6 @@ public static void serialize(float[] feats, ByteBuf output) {
}
}

public static void serializeShortFromFloat(float[] feats, ByteBuf output) {
if (feats != null) {
output.writeInt(feats.length);
for (int i = 0; i < feats.length; i++) {
output.writeShort(HalfPrecisionConversion.toHalfPrecision(feats[i]));
}
} else {
output.writeInt(0);
}
}

public static void serialize(double[] feats, ByteBuf output) throws IOException {
if (feats != null) {
output.writeInt(feats.length);
Expand Down Expand Up @@ -276,19 +264,6 @@ public static float[] deserializeFloats(ByteBuf input) {
}
}

public static float[] deserializeFloatFromShort(ByteBuf input) {
int len = input.readInt();
if (len > 0) {
float[] res = new float[len];
for (int i = 0; i < len; i++) {
res[i] = HalfPrecisionConversion.fromHalfPrecision(input.readShort());
}
return res;
} else {
return null;
}
}

public static double[] deserializeDoubles(ByteBuf input) {
int len = input.readInt();
if (len > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package com.tencent.angel.graph.common.data;

import com.tencent.angel.graph.utils.HalfPrecisionConversion;
import com.tencent.angel.ml.math2.VFactory;
import com.tencent.angel.ml.math2.vector.IntFloatVector;
import com.tencent.angel.ps.storage.vector.storage.StorageMethod;
Expand Down Expand Up @@ -204,17 +203,6 @@ public static void serialize(float[] feats, ByteBuf output) {
}
}

public static void serializeShortFromFloat(float[] feats, ByteBuf output) {
if (feats != null) {
output.writeInt(feats.length);
for (int i = 0; i < feats.length; i++) {
output.writeShort(HalfPrecisionConversion.toHalfPrecision(feats[i]));
}
} else {
output.writeInt(0);
}
}

public static void serialize(double[] feats, ByteBuf output) throws IOException {
if (feats != null) {
output.writeInt(feats.length);
Expand Down Expand Up @@ -276,19 +264,6 @@ public static float[] deserializeFloats(ByteBuf input) {
}
}

public static float[] deserializeFloatFromShort(ByteBuf input) {
int len = input.readInt();
if (len > 0) {
float[] res = new float[len];
for (int i = 0; i < len; i++) {
res[i] = HalfPrecisionConversion.fromHalfPrecision(input.readShort());
}
return res;
} else {
return null;
}
}

public static double[] deserializeDoubles(ByteBuf input) {
int len = input.readInt();
if (len > 0) {
Expand Down

0 comments on commit ff3ed83

Please sign in to comment.