flopscope.numpy.random.bytes
fnp.random.bytes(length)[flopscope source]
Return random bytes.
Adapted from NumPy docs np.random.bytes
Cost
per-operation
Flopscope Context
Sampling; cost = numel(output).
Note.
New code should use the bytes method of a Generator instance instead; please see the random-quick-start.
Parameters
- length:int
Number of random bytes.
Returns
- out:bytes
String of length
length.
See also
- we.flops.random.Generator.bytes which should be used for new code.
Examples
>>> flops.random.bytes(10)
b' eh\x85\x022SZ\xbf\xa4' #random