diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-06-09 13:37:04 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-06-09 14:49:38 -0700 |
commit | b62ddf7cb5224b078a4dd325640227680641485a (patch) | |
tree | 5baf4c11338b2cde8e9eea12bdd64b4666e5384d /tensorflow/core/graph/testlib.cc | |
parent | 75ba1a81703baec0a8362a2d475c4180bdc34c1b (diff) |
Adds tf.random_gamma(shape, alpha, beta) to tf core.
Adds a sample method to the Gamma distribution which uses this op.
Change: 124498685
Diffstat (limited to 'tensorflow/core/graph/testlib.cc')
-rw-r--r-- | tensorflow/core/graph/testlib.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/core/graph/testlib.cc b/tensorflow/core/graph/testlib.cc index ec878437dc..ddd20d5adf 100644 --- a/tensorflow/core/graph/testlib.cc +++ b/tensorflow/core/graph/testlib.cc @@ -188,6 +188,16 @@ Node* TruncatedNormal(Graph* g, Node* input, DataType dtype) { return RandomNumberGenerator("TruncatedNormal", g, input, dtype); } +Node* RandomGamma(Graph* g, Node* shape, Node* alpha) { + Node* ret; + TF_CHECK_OK(NodeBuilder(g->NewName("n"), "RandomGamma") + .Input(shape) + .Input(alpha) + .Attr("seed", 0) + .Finalize(g, &ret)); + return ret; +} + Node* Unary(Graph* g, const string& func, Node* input, int index) { Node* ret; TF_CHECK_OK(NodeBuilder(g->NewName("n"), func, g->op_registry()) |