提交 47556689 编写于 作者: D dongzhihong

"remove unused code"

上级 4d8ece8a
......@@ -26,7 +26,6 @@ public:
void Compute(const framework::KernelContext& context) const override {
auto mean = context.op_.GetAttr<T>("mean");
auto std = context.op_.GetAttr<T>("std");
// auto seed = context.op_.GetAttr<T>("seed");
auto* output = context.Output(0)->GetMutable<framework::Tensor>();
T* r = output->mutable_data<T>(context.GetPlace());
auto ctx =
......@@ -60,7 +59,6 @@ public:
framework::OpAttrChecker* op_checker)
: framework::OpProtoAndCheckerMaker(proto, op_checker) {
AddAttr<std::vector<int>>("shape", "The shape of matrix to be randomized");
// AddAttr<float>("seed", "random seed generator.").SetDefault(1337);
AddAttr<float>("mean", "mean value of random.").SetDefault(.0);
AddAttr<float>("std", "minimum value of random value")
.SetDefault(1.0)
......
......@@ -10,7 +10,7 @@ class TestRandomOp(unittest.TestCase):
scope = core.Scope(None)
# Out = scope.create_var("Out")
op = creation.op_creations.gaussian_random(
shape=[1000, 1000], mean=5.0, std=1.0, seed=1701, Out="Out")
shape=[1000, 1000], mean=5.0, std=1.0, Out="Out")
for out in op.outputs():
if scope.get_var(out) is None:
scope.create_var(out).get_tensor()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册