Skip to content

Is the codebase re-seeding on every random tensor generation (if so, can I control the reseeding period)? #143

Open
@kwmaeng91

Description

@kwmaeng91

Dear experts,

From what I understood, this codebase samples a random number from /dev/urandom each time when generating a new random tensor, and uses it as a seed to generate the rest of the random tensor
(I got the idea from here: #43 (comment)).

I am confused about this behavior for two reasons:

  1. If AES-CTR is CSPRNG, my understanding is that it does not need to be reseeded. Why is it reseeding on every tensor generation?
  2. If my understanding is correct, the reseeding period seems arbitrary. If I generate a huge random tensor, a lot of random numbers will be generated from a single 128-bit value from /dev/urandom. If I generate multiple small tensors, /dev/urandom will be sampled very frequently. Can I control the reseeding frequency?

Please let me know if I am mistaken in any ways. My understanding of how this codebase works (and/or how CSPRNG works) might be incorrect.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions