Skip to content

Commit ff3ed83

Browse files
committed
remove HalfPrecisionConversion。
1 parent f5f20c9 commit ff3ed83

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*.class
1919
angel-ps/core/target/
2020
angel-ps/psf/target/
21-
angel-ps/graph/
21+
angel-ps/graph/target/
2222
angel-ps/examples/target/
2323
angel-ps/jarvis/target/
2424
angel-ps/tools/target/

angel-ps/graph/src/main/java/com/tencent/angel/graph/data/NodeUtils.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package com.tencent.angel.graph.data;
1818

19-
import com.tencent.angel.graph.utils.HalfPrecisionConversion;
2019
import com.tencent.angel.ml.math2.VFactory;
2120
import com.tencent.angel.ml.math2.vector.IntFloatVector;
2221
import com.tencent.angel.ps.storage.vector.storage.StorageMethod;
@@ -204,17 +203,6 @@ public static void serialize(float[] feats, ByteBuf output) {
204203
}
205204
}
206205

207-
public static void serializeShortFromFloat(float[] feats, ByteBuf output) {
208-
if (feats != null) {
209-
output.writeInt(feats.length);
210-
for (int i = 0; i < feats.length; i++) {
211-
output.writeShort(HalfPrecisionConversion.toHalfPrecision(feats[i]));
212-
}
213-
} else {
214-
output.writeInt(0);
215-
}
216-
}
217-
218206
public static void serialize(double[] feats, ByteBuf output) throws IOException {
219207
if (feats != null) {
220208
output.writeInt(feats.length);
@@ -276,19 +264,6 @@ public static float[] deserializeFloats(ByteBuf input) {
276264
}
277265
}
278266

279-
public static float[] deserializeFloatFromShort(ByteBuf input) {
280-
int len = input.readInt();
281-
if (len > 0) {
282-
float[] res = new float[len];
283-
for (int i = 0; i < len; i++) {
284-
res[i] = HalfPrecisionConversion.fromHalfPrecision(input.readShort());
285-
}
286-
return res;
287-
} else {
288-
return null;
289-
}
290-
}
291-
292267
public static double[] deserializeDoubles(ByteBuf input) {
293268
int len = input.readInt();
294269
if (len > 0) {

spark-on-angel/graph/src/main/java/com/tencent/angel/graph/common/data/NodeUtils.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package com.tencent.angel.graph.common.data;
1818

19-
import com.tencent.angel.graph.utils.HalfPrecisionConversion;
2019
import com.tencent.angel.ml.math2.VFactory;
2120
import com.tencent.angel.ml.math2.vector.IntFloatVector;
2221
import com.tencent.angel.ps.storage.vector.storage.StorageMethod;
@@ -204,17 +203,6 @@ public static void serialize(float[] feats, ByteBuf output) {
204203
}
205204
}
206205

207-
public static void serializeShortFromFloat(float[] feats, ByteBuf output) {
208-
if (feats != null) {
209-
output.writeInt(feats.length);
210-
for (int i = 0; i < feats.length; i++) {
211-
output.writeShort(HalfPrecisionConversion.toHalfPrecision(feats[i]));
212-
}
213-
} else {
214-
output.writeInt(0);
215-
}
216-
}
217-
218206
public static void serialize(double[] feats, ByteBuf output) throws IOException {
219207
if (feats != null) {
220208
output.writeInt(feats.length);
@@ -276,19 +264,6 @@ public static float[] deserializeFloats(ByteBuf input) {
276264
}
277265
}
278266

279-
public static float[] deserializeFloatFromShort(ByteBuf input) {
280-
int len = input.readInt();
281-
if (len > 0) {
282-
float[] res = new float[len];
283-
for (int i = 0; i < len; i++) {
284-
res[i] = HalfPrecisionConversion.fromHalfPrecision(input.readShort());
285-
}
286-
return res;
287-
} else {
288-
return null;
289-
}
290-
}
291-
292267
public static double[] deserializeDoubles(ByteBuf input) {
293268
int len = input.readInt();
294269
if (len > 0) {

0 commit comments

Comments
 (0)