Skip to content

Commit

Permalink
Fix reduce scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Aug 21, 2024
1 parent 1208250 commit 96e8ba9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ def nonzero_slices(x: Tensor):
def reduce_(f, value, dims, require_all_dims_present=False, required_kind: type = None):
if not dims:
return value
is_tree = not isinstance(value, Tensor)
is_tree = not isinstance(value, Tensor) and isinstance(value, PhiTreeNode)
if isinstance(value, (tuple, list)) and all(isinstance(v, Tensor) for v in value):
dims = merge_shapes(batch('0'), *value).only(dims)
is_tree = '0' not in dims
Expand Down

0 comments on commit 96e8ba9

Please sign in to comment.