nvidia.dali.fn.batch_permutation#

nvidia.dali.fn.batch_permutation(*, allow_repetitions=False, bytes_per_sample_hint=[0], no_fixed_points=False, preserve=False, seed=-1, device=None, name=None)#

生成一批随机整数,可以用作批处理中索引样本的索引。

支持的后端
  • ‘cpu’

关键字参数:
  • allow_repetitions (bool, optional, default = False) – 如果为 true,则输出可以包含重复和遗漏。

  • bytes_per_sample_hint (int or list of int, optional, default = [0]) –

    输出大小提示,单位为每样本字节数。

    如果指定,则驻留在 GPU 或页锁定主机内存中的运算符输出将被预先分配以容纳此大小的样本批次。

  • no_fixed_points (bool, optional, default = False) – 如果为 true,则输出置换不能包含不动点,即 out[i] != i。当批次大小为 1 时,将忽略此参数。

  • preserve (bool, optional, default = False) – 阻止运算符从图中删除,即使其输出未使用。

  • seed (int, optional, default = -1) – 随机种子;如果未设置,将自动分配一个。