aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/testlib.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-06-09 13:37:04 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-06-09 14:49:38 -0700
commitb62ddf7cb5224b078a4dd325640227680641485a (patch)
tree5baf4c11338b2cde8e9eea12bdd64b4666e5384d /tensorflow/core/graph/testlib.cc
parent75ba1a81703baec0a8362a2d475c4180bdc34c1b (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.cc10
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())