Skip to content

Commit

Permalink
changed return type of norms.l0 to same as input like lx (was always …
Browse files Browse the repository at this point in the history
…int)
  • Loading branch information
Jonas Rauber committed Feb 13, 2020
1 parent b945b6c commit 6bee896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eagerpy/norms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def l0(
x: TensorType, axis: Optional[AxisAxes] = None, keepdims: bool = False
) -> TensorType:
return (x != 0).sum(axis=axis, keepdims=keepdims)
return (x != 0).sum(axis=axis, keepdims=keepdims).astype(x.dtype)


def l1(
Expand Down

0 comments on commit 6bee896

Please sign in to comment.