Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6833bb03 authored by hhakim's avatar hhakim
Browse files

Minor simplifications.

parent 7dd8443b
No related branches found
No related tags found
No related merge requests found
...@@ -252,13 +252,10 @@ def poly(coeffs, basis='chebyshev', L=None, X=None, dev='cpu', out=None, ...@@ -252,13 +252,10 @@ def poly(coeffs, basis='chebyshev', L=None, X=None, dev='cpu', out=None,
from pyfaust.poly import basis as _basis from pyfaust.poly import basis as _basis
basis = F = _basis(L, K, basis, dev=dev, impl=impl) basis = F = _basis(L, K, basis, dev=dev, impl=impl)
if isFaust(basis): if not isinstance(basis, np.ndarray) and not isFaust(basis):
F = basis
elif not isinstance(basis, np.ndarray):
raise TypeError('basis is neither a str neither a Faust nor' raise TypeError('basis is neither a str neither a Faust nor'
' a numpy.ndarray') ' a numpy.ndarray')
else: F = basis
F = basis
if L == None: if L == None:
d = F.shape[0]//(K+1) d = F.shape[0]//(K+1)
else: else:
...@@ -287,7 +284,7 @@ def poly(coeffs, basis='chebyshev', L=None, X=None, dev='cpu', out=None, ...@@ -287,7 +284,7 @@ def poly(coeffs, basis='chebyshev', L=None, X=None, dev='cpu', out=None,
Fc = Fc.clone(dev=dev) Fc = Fc.clone(dev=dev)
return Fc return Fc
else: else:
if not isinstance(X, type(None)): if X is not None:
raise X_and_basis_an_array_error raise X_and_basis_an_array_error
return _poly_arr_cpp(coeffs, F, d, dev=dev, out=out) return _poly_arr_cpp(coeffs, F, d, dev=dev, out=out)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment