"change empty gradient to error"

gangliao-patch-1
dongzhihong 8 years ago
parent 44e3924663
commit c5e8e27ba6

@ -1,6 +1,7 @@
package pserver
import (
"errors"
"hash/fnv"
"sort"
"time"
@ -124,8 +125,7 @@ func (c *Client) FinishInitParams() error {
// parameters.
func (c *Client) SendGrads(grads []Gradient) error {
if len(grads) == 0 {
log.Info("Send Empty Gradient")
return nil
return errors.New("no gradient received")
}
errCh := make(chan error, len(grads))
for _, g := range grads {

Loading…
Cancel
Save