deepmd.tf.nvnmd.utils.encode
Module Contents
Classes
Encoding value as hex, bin, and dec format. |
Attributes
- class deepmd.tf.nvnmd.utils.encode.Encode[source]
Encoding value as hex, bin, and dec format.
- byte2hex(bs, nbyte)[source]
Convert byte into hex bs: low byte in the first hex: low byte in the right.
- check_dec(idec, nbit, signed=False, name='')[source]
Check whether the data (idec) is in the range range is \([0, 2^nbit-1]\) for unsigned range is \([-2^{nbit-1}, 2^{nbit-1}-1]\) for signed.
- extend_list(slbin, nfull)[source]
Extend the list (slbin) to the length (nfull) the attched element of list is 0.
such as, when
slbin = [‘10010’,’10100’],nfull = 4extent it to
[‘10010’,’10100’,’00000’,’00000]