Skip to content

Commit

Permalink
hotfix: fix typo (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperzhong authored Jul 30, 2020
1 parent 8b1218d commit ced6f2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion byteps/common/compressor/impl/randomk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CompressorRegistry::Register reg(
auto factor = HyperParamFinder<float>(kwargs, "compressor_k", false,
[](float x) { return x > 0; });
unsigned k;
if (k < 1) {
if (factor < 1) {
k = static_cast<unsigned>(factor * size / getDataTypeLength(dtype));
} else {
k = static_cast<unsigned>(factor);
Expand Down
2 changes: 1 addition & 1 deletion byteps/common/compressor/impl/topk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CompressorRegistry::Register reg(
auto factor = HyperParamFinder<float>(kwargs, "compressor_k", false,
[](float x) { return x > 0; });
unsigned k;
if (k < 1) {
if (factor < 1) {
k = static_cast<unsigned>(factor * size / getDataTypeLength(dtype));
} else {
k = static_cast<unsigned>(factor);
Expand Down

0 comments on commit ced6f2b

Please sign in to comment.