CheckMethod¶
- class paddle.fluid.contrib.sparsity.utils. CheckMethod ( value ) [source]
-
A collection of all sparsity checking approaches. There currently are two methods, CHECK_1D and CHECK_2D
-
static
get_checking_method
(
mask_algo
)
get_checking_method¶
-
Get sparsity checking method by mask generating algorithm.
- Parameters
-
mask_algo (MaskAlgo) – The algorithm of mask generating.
- Returns
-
The corresponded sparsity checking method.
- Return type
-
CheckMethod
Examples
import numpy as np from paddle.static.sparsity import MaskAlgo from paddle.fluid.contrib.sparsity import CheckMethod
CheckMethod.get_checking_method(MaskAlgo.MASK_1D) # CheckMethod.CHECK_1D
CheckMethod.get_checking_method(MaskAlgo.MASK_2D_GREEDY) # CheckMethod.CHECK_2D
CheckMethod.get_checking_method(MaskAlgo.MASK_2D_BEST) # CheckMethod.CHECK_2D
-
static
get_checking_method
(
mask_algo
)