File tree 11 files changed +11
-81
lines changed
11 files changed +11
-81
lines changed Original file line number Diff line number Diff line change @@ -20,5 +20,6 @@ sh_binary(
20
20
"required_packages.py" ,
21
21
"setup.py" ,
22
22
"//tensorflow_probability" ,
23
+ "//tensorflow_probability/substrates" ,
23
24
],
24
25
)
Original file line number Diff line number Diff line change 20
20
collect_ignore = [
21
21
"discussion/" ,
22
22
"setup.py" ,
23
- "tensorflow_probability/python/experimental/substrates/"
24
23
]
25
24
26
25
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ py_library(
41
41
"//tensorflow_probability/python/glm" ,
42
42
"//tensorflow_probability/python/internal" ,
43
43
"//tensorflow_probability/python/internal:all_util" ,
44
+ "//tensorflow_probability/python/internal:lazy_loader" ,
44
45
"//tensorflow_probability/python/layers" ,
45
46
"//tensorflow_probability/python/math" ,
46
47
"//tensorflow_probability/python/mcmc" ,
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ multi_substrate_py_library(
41
41
"//tensorflow_probability/python/experimental/auto_batching" ,
42
42
"//tensorflow_probability/python/experimental/marginalize" ,
43
43
"//tensorflow_probability/python/experimental/nn" ,
44
- "//tensorflow_probability/python/experimental/substrates" ,
45
44
"//tensorflow_probability/python/experimental/timeseries" ,
46
45
"//tensorflow_probability/python/internal:auto_composite_tensor" ,
47
46
"//tensorflow_probability/python/experimental/util:composite_tensor" ,
@@ -64,7 +63,6 @@ multi_substrate_py_library(
64
63
"//tensorflow_probability/python/experimental/sequential" ,
65
64
"//tensorflow_probability/python/experimental/stats" ,
66
65
"//tensorflow_probability/python/experimental/sts_gibbs" ,
67
- "//tensorflow_probability/python/experimental/substrates" ,
68
66
"//tensorflow_probability/python/experimental/tangent_spaces" ,
69
67
"//tensorflow_probability/python/experimental/timeseries" ,
70
68
"//tensorflow_probability/python/experimental/util" ,
Original file line number Diff line number Diff line change 43
43
from tensorflow_probability .python .experimental import sequential
44
44
from tensorflow_probability .python .experimental import stats
45
45
from tensorflow_probability .python .experimental import sts_gibbs
46
- from tensorflow_probability .python .experimental import substrates
47
46
from tensorflow_probability .python .experimental import tangent_spaces
48
47
from tensorflow_probability .python .experimental import timeseries
49
48
from tensorflow_probability .python .experimental import util
76
75
'sequential' ,
77
76
'sts_gibbs' ,
78
77
'stats' ,
79
- 'substrates' ,
80
78
'tangent_spaces' ,
81
79
'timeseries' ,
82
80
'unnest' ,
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 19
19
import types
20
20
21
21
22
+ __all__ = ['LazyLoader' ]
23
+
24
+
22
25
class LazyLoader (types .ModuleType ):
23
26
"""Lazily import a module to avoid pulling in large deps, defer checks."""
24
27
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ py_library(
32
32
srcs = [
33
33
"__init__.py" ,
34
34
],
35
+ # :substrates needs to be visible to the external :pip_pkg target.
36
+ visibility = ["//visibility:public" ], # EnableOnExport
35
37
deps = [
36
38
":jax" ,
37
39
":numpy" ,
Original file line number Diff line number Diff line change @@ -258,6 +258,9 @@ def disable_all(name):
258
258
if FLAGS .numpy_to_jax :
259
259
contents = contents .replace ('tfp.substrates.numpy' , 'tfp.substrates.jax' )
260
260
contents = contents .replace ('substrates.numpy' , 'substrates.jax' )
261
+ contents = contents .replace (
262
+ 'tensorflow_probability.substrates import numpy' ,
263
+ 'tensorflow_probability.substrates import jax' )
261
264
contents = contents .replace ('backend.numpy' , 'backend.jax' )
262
265
contents = contents .replace ('backend import numpy as tf' ,
263
266
'backend import jax as tf' )
Original file line number Diff line number Diff line change 46
46
47
47
FLAGS = flags .FLAGS
48
48
49
- DO_NOT_GENERATE_DOCS_FOR = [
50
- tfp .experimental .substrates .jax .tf2jax ,
51
- tfp .experimental .substrates .jax .experimental ,
52
- tfp .experimental .substrates .numpy .tf2numpy ,
53
- tfp .experimental .substrates .numpy .experimental ,
54
- ]
49
+ DO_NOT_GENERATE_DOCS_FOR = []
55
50
56
51
57
52
def internal_filter (path , parent , children ):
You can’t perform that action at this time.
0 commit comments