Exemplo n.º 1
0
Arquivo: math.py Projeto: hsaputra/tvm
def log2(x):
    """Take logarithm to the base 2 of input x.

    Parameters
    ----------
    x : tvm.te.Tensor
        Input argument.

    Returns
    -------
    y : tvm.te.Tensor
        The result.
    """
    return te.compute(x.shape, lambda *i: te.log2(x(*i)))
Exemplo n.º 2
0
 def clz_imp(inp):
     # Assuming that it's a 32 bit int
     return 32 - te.log2(inp)