예제 #1
0
 public void Bernoulli(NDArray result, int?seed, float p)
 {
     using (var cpuCopy = new NDArray(cpuAllocator, result.ElementType, result.Shape))
     {
         cpuRandom.Bernoulli(cpuCopy, seed, p);
         TOps.Copy(result, cpuCopy);
     }
 }
예제 #2
0
 public void Bernoulli(Tensor result, int?seed, float p)
 {
     using (Tensor cpuCopy = new Tensor(cpuAllocator, result.ElementType, result.Sizes))
     {
         cpuRandom.Bernoulli(cpuCopy, seed, p);
         Ops.Copy(result, cpuCopy);
     }
 }