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); } }
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); } }