MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TEST

Function TEST

imperative/src/test/rng.cpp:80–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80TEST(TestImperative, PoissonRNGBasic) {
81 REQUIRE_XPU(2);
82 for (auto&& cn : {CompNode::load("xpu0"), CompNode::load("xpu1")}) {
83 TensorShape shape{5, 3000};
84 HostTensorND lam{cn, shape, dtype::Float32()};
85 auto lam_ptr = lam.ptr<float>();
86 for (int i = 0; i < 5 * 3000; ++i)
87 lam_ptr[i] = 2;
88 SmallVector<TensorPtr> inputs{Tensor::make(lam)};
89 check_rng_with_input_basic<PoissonRNG>(cn, inputs, 123);
90 }
91}
92
93TEST(TestImperative, BetaRNGBasic) {
94 REQUIRE_XPU(2);

Callers

nothing calls this directly

Calls 2

loadFunction · 0.50
makeFunction · 0.50

Tested by

no test coverage detected