Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 38a28294 authored by hhakim's avatar hhakim
Browse files

Fix dtype constraint in Faust.optimize_time constraint (F.dtype == M or...

Fix dtype constraint in Faust.optimize_time constraint (F.dtype == M or S.dtype) and adjust the doc for matfaust and pyfaust.
parent a3c8870d
Branches
Tags
No related merge requests found
......@@ -537,10 +537,10 @@ class TestFaustPy(unittest.TestCase):
G.m_faust.set_FM_mul_mode(FaustMulMode.DYNPROG)
self.assertTrue(np.allclose(self.F.toarray(), H.toarray()))
self.assertTrue(np.allclose(self.F.toarray(), G.toarray()))
M = np.random.rand(self.F.shape[1], self.F.shape[0])
M = np.random.rand(self.F.shape[1], self.F.shape[0]).astype(self.F.dtype)
self.assertTrue(np.allclose(self.F@M, H@M))
self.assertTrue(np.allclose(self.F@M, G@M))
S = sparse.random(self.F.shape[1], self.F.shape[0], .2, format='csr')
S = sparse.random(self.F.shape[1], self.F.shape[0], .2, format='csr').astype(self.F.dtype)
self.assertTrue(np.allclose(self.F@S, H@S))
self.assertTrue(np.allclose(self.F@S, G@S))
# test any method chosen by optimize_time
......
......@@ -799,7 +799,7 @@ classdef Faust
%> calculated in order to measure time taken by each method (it could matter
%> to discriminate methods when the performances are similar). By default,
%> only one product is computed to evaluate the method.
%> @param 'mat', matrix (optional) Use this argument to run the benchmark on the Faust multiplication by the matrix mat instead of Faust.full().
%> @param 'mat', matrix (optional) Use this argument to run the benchmark on the Faust multiplication by the matrix mat instead of Faust.full(). Note that mat must be of the same scalar type as F.
%>
%> @retval OF The optimized Faust.
%>
......
......@@ -18,7 +18,7 @@ classdef FaustMulMode
%>
%> This method is only available for the specific packages pyfaust_torch.
TORCH_CPU_L2R=8
%> \brief The method is basically the same as GREEDY_ALL_BEST_GENMAT but it is implemented using the Torch library.
%> \brief The method is basically the same as GREEDY but it is implemented using the Torch library.
%>
%> This method is only available for the specific packages pyfaust_torch.
TORCH_CPU_GREEDY=9
......
......@@ -2101,12 +2101,12 @@ class Faust(numpy.lib.mixins.NDArrayOperatorsMixin):
transp: True in order to optimize the Faust according to its transpose.
nsamples: the number of Faust-Dense matrix products
calculated in order to measure time taken by each method (it could matter
to discriminate methods when the performances are similar). By default,
to discriminate methods when the performance is similar). By default,
only one product is computed to evaluate the method.
mat: if not None must be a numpy.ndarray or a
scipy.sparse.csr_matrix. Use this argument to run the benchmark on
the Faust multiplication by the matrix mat instead of Faust.toarray() (if mat
is None).
is None). Note that mat must be of the same dtype as F.
Returns:
The optimized Faust.
......@@ -2990,7 +2990,7 @@ class FaustMulMode:
##
## This method is only available for the specific packages pyfaust_torch.
TORCH_CPU_L2R=8
## \brief The method is basically the same as GREEDY_ALL_BEST_GENMAT but it is implemented using the Torch library.
## \brief The method is basically the same as GREEDY but it is implemented using the Torch library.
##
## This method is only available for the specific packages pyfaust_torch.
TORCH_CPU_GREEDY=9
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment