Skip to content

Commit f377715

Browse files
authored
Merge pull request #1466 from emilyfertig/r0.15
R0.15
2 parents 76eaa7e + 47f35da commit f377715

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

tensorflow_probability/python/bijectors/blockwise_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ def call_forward(bij, x):
314314
self.assertAllClose(call_forward(unflat, x), blockwise.forward(x))
315315

316316
# Type spec can be encoded/decoded.
317-
enc = tf.__internal__.saved_model.encode_structure(blockwise._type_spec)
318-
dec = tf.__internal__.saved_model.decode_proto(enc)
317+
struct_coder = tf.__internal__.saved_model.StructureCoder()
318+
enc = struct_coder.encode_structure(blockwise._type_spec)
319+
dec = struct_coder.decode_proto(enc)
319320
self.assertEqual(blockwise._type_spec, dec)
320321

321322
def testNonCompositeTensor(self):

tensorflow_probability/python/bijectors/chain_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,9 @@ def call_forward(bij, x):
432432
self.assertAllClose(call_forward(unflat, x), chain.forward(x))
433433

434434
# TypeSpec can be encoded/decoded.
435-
enc = tf.__internal__.saved_model.encode_structure(chain._type_spec)
436-
dec = tf.__internal__.saved_model.decode_proto(enc)
435+
struct_coder = tf.__internal__.saved_model.StructureCoder()
436+
enc = struct_coder.encode_structure(chain._type_spec)
437+
dec = struct_coder.decode_proto(enc)
437438
self.assertEqual(chain._type_spec, dec)
438439

439440
def testNonCompositeTensor(self):

tensorflow_probability/python/bijectors/joint_map_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ def call_forward(bij, x):
150150
self.assertAllCloseNested(call_forward(unflat, x), bij.forward(x))
151151

152152
# Type spec can be encoded/decoded.
153-
enc = tf.__internal__.saved_model.encode_structure(bij._type_spec)
154-
dec = tf.__internal__.saved_model.decode_proto(enc)
153+
struct_coder = tf.__internal__.saved_model.StructureCoder()
154+
enc = struct_coder.encode_structure(bij._type_spec)
155+
dec = struct_coder.decode_proto(enc)
155156
self.assertEqual(bij._type_spec, dec)
156157

157158
def testNonCompositeTensor(self):

tensorflow_probability/python/experimental/util/composite_tensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ def composite_helper(v):
279279
mk_err_msg('(Unable to convert dependent entry \'{}\' of object '
280280
'\'{}\': {})'.format(k, obj, str(e))))
281281
result = cls(**kwargs)
282+
struct_coder = nested_structure_coder.StructureCoder()
282283
try:
283-
nested_structure_coder.encode_structure(result._type_spec) # pylint: disable=protected-access
284+
struct_coder.encode_structure(result._type_spec) # pylint: disable=protected-access
284285
except nested_structure_coder.NotEncodableError as e:
285286
raise NotImplementedError(
286287
mk_err_msg('(Unable to serialize: {})'.format(str(e))))

tensorflow_probability/python/internal/auto_composite_tensor_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,9 @@ def test_save_restore_functor(self):
362362
a = tf.constant([3., 2.])
363363
ct = ThingWithCallableArg(a, f=f)
364364

365+
struct_coder = tf.__internal__.saved_model.StructureCoder()
365366
with self.assertRaisesRegex(ValueError, 'Cannot serialize'):
366-
tf.__internal__.saved_model.encode_structure(ct._type_spec) # pylint: disable=protected-access
367+
struct_coder.encode_structure(ct._type_spec) # pylint: disable=protected-access
367368

368369
@tfp.experimental.auto_composite_tensor(module_name='my.module')
369370
class F(tfp.experimental.AutoCompositeTensor):
@@ -372,8 +373,8 @@ def __call__(self, *args, **kwargs):
372373
return f(*args, **kwargs)
373374

374375
ct_functor = ThingWithCallableArg(a, f=F())
375-
enc = tf.__internal__.saved_model.encode_structure(ct_functor._type_spec)
376-
dec = tf.__internal__.saved_model.decode_proto(enc)
376+
enc = struct_coder.encode_structure(ct_functor._type_spec)
377+
dec = struct_coder.decode_proto(enc)
377378
self.assertEqual(dec, ct_functor._type_spec)
378379

379380
def test_composite_tensor_callable_arg(self):

tensorflow_probability/python/mcmc/simple_step_size_adaptation_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ class SimpleStepSizeAdaptationStaticBroadcastingTest(test_util.TestCase):
471471
)
472472
def testBroadcasting(self, old_step_size, new_step_size):
473473
log_accept_ratio = tf.constant(
474-
[[np.log(0.73), np.log(0.76), np.log(0.73)],
474+
[[np.log(0.72), np.log(0.76), np.log(0.73)],
475475
[np.log(0.77), np.log(0.77), np.log(0.73)]],
476476
dtype=tf.float64)
477477
log_accept_ratio = tf1.placeholder_with_default(

tensorflow_probability/python/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# stable release (indicated by `_VERSION_SUFFIX = ''`). Outside the context of a
2525
# release branch, the current version is by default assumed to be a
2626
# 'development' version, labeled 'dev'.
27-
_VERSION_SUFFIX = 'dev'
27+
_VERSION_SUFFIX = ''
2828

2929
# Example, '0.4.0-dev'
3030
__version__ = '.'.join([

0 commit comments

Comments
 (0)