File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -3872,7 +3872,7 @@ def apply(self, paddle_api: str) -> ConvertResult:
38723872 result = (x!= 0).sum(dim=axis, keepdim=True).to(x.dtype)
38733873 else:
38743874 result = (x!= 0).sum(dim=axis).to(x.dtype)
3875- elif len(x.shape)>2 and axis is None:
3875+ elif len(x.shape)>= 2 and axis is None:
38763876 if p==math.inf:
38773877 if keepdim:
38783878 result = x.abs().amax().reshape([1] * x.ndim)
@@ -3884,7 +3884,12 @@ def apply(self, paddle_api: str) -> ConvertResult:
38843884 else:
38853885 result = x.abs().amin()
38863886 else:
3887+ _kwargs["input"] = x.flatten()
3888+ if p == "fro":
3889+ _kwargs["ord"] = 2
38873890 result = { self .torch_api } (**_kwargs)
3891+ if keepdim:
3892+ result = result.reshape([1] * x.ndim)
38883893else:
38893894 result = { self .torch_api } (**_kwargs)
38903895"""
You can’t perform that action at this time.
0 commit comments