Home | History | Annotate | Download | only in stateless
      1 # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #     http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 # ==============================================================================
     15 """Stateless random ops which take seed as a tensor input.
     16 
     17 Instead of taking `seed` as an attr which initializes a mutable state within
     18 the op, these random ops take `seed` as an input, and the random numbers are
     19 a deterministic function of `shape` and `seed`.
     20 
     21 WARNING: These ops are in contrib, and are not stable.  They should be
     22 consistent across multiple runs on the same hardware, but only for the same
     23 version of the code.
     24 
     25 @@stateless_random_uniform
     26 @@stateless_random_normal
     27 @@stateless_truncated_normal
     28 """
     29 
     30 from __future__ import absolute_import
     31 from __future__ import division
     32 from __future__ import print_function
     33 
     34 # pylint: disable=wildcard-import
     35 from tensorflow.contrib.stateless.gen_stateless_random_ops import *
     36 
     37 from tensorflow.python.framework import ops
     38 from tensorflow.python.util.all_util import remove_undocumented
     39 
     40 ops.NotDifferentiable("StatelessRandomNormal")
     41 ops.NotDifferentiable("StatelessRandomUniform")
     42 ops.NotDifferentiable("StatelessTruncatedNormal")
     43 
     44 remove_undocumented(__name__)
     45