Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
8fa74104
"docs/en/vscode:/vscode.git/clone" did not exist on "8de2a2899b68a834d9fe717ff7ff74bf3258668a"
Commit
8fa74104
authored
Mar 09, 2022
by
A. Unique TensorFlower
Committed by
saberkun
Mar 09, 2022
Browse files
Internal change
PiperOrigin-RevId: 433453559
parent
6a2a62a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
official/utils/docs/build_nlp_api_docs.py
official/utils/docs/build_nlp_api_docs.py
+1
-1
official/utils/docs/build_vision_api_docs.py
official/utils/docs/build_vision_api_docs.py
+33
-8
No files found.
official/utils/docs/build_nlp_api_docs.py
View file @
8fa74104
...
@@ -37,7 +37,7 @@ FLAGS = flags.FLAGS
...
@@ -37,7 +37,7 @@ FLAGS = flags.FLAGS
flags
.
DEFINE_string
(
'output_dir'
,
None
,
'Where to write the resulting docs to.'
)
flags
.
DEFINE_string
(
'output_dir'
,
None
,
'Where to write the resulting docs to.'
)
flags
.
DEFINE_string
(
flags
.
DEFINE_string
(
'code_url_prefix'
,
'code_url_prefix'
,
'https://github.com/tensorflow/models/blob/master/official/nlp/modeling
/
'
,
'https://github.com/tensorflow/models/blob/master/official/nlp/modeling'
,
'The url prefix for links to code.'
)
'The url prefix for links to code.'
)
flags
.
DEFINE_bool
(
'search_hints'
,
True
,
flags
.
DEFINE_bool
(
'search_hints'
,
True
,
...
...
official/utils/docs/build_vision_api_docs.py
View file @
8fa74104
...
@@ -21,7 +21,7 @@ $> python build_vision_api_docs \
...
@@ -21,7 +21,7 @@ $> python build_vision_api_docs \
--output_dir=/tmp/api_docs
--output_dir=/tmp/api_docs
"""
"""
import
os
import
pathlib
from
absl
import
app
from
absl
import
app
from
absl
import
flags
from
absl
import
flags
...
@@ -29,15 +29,16 @@ from absl import logging
...
@@ -29,15 +29,16 @@ from absl import logging
from
tensorflow_docs.api_generator
import
generate_lib
from
tensorflow_docs.api_generator
import
generate_lib
from
tensorflow_docs.api_generator
import
public_api
from
tensorflow_docs.api_generator
import
public_api
import
tensorflow_models
as
tfm
import
build_api_docs_lib
import
build_api_docs_lib
from
official.vision.beta
import
modeling
as
tfvision
FLAGS
=
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
flags
.
DEFINE_string
(
'output_dir'
,
None
,
'Where to write the resulting docs to.'
)
flags
.
DEFINE_string
(
'output_dir'
,
None
,
'Where to write the resulting docs to.'
)
flags
.
DEFINE_string
(
flags
.
DEFINE_string
(
'code_url_prefix'
,
'code_url_prefix'
,
'https://github.com/tensorflow/models/blob/master/
official/vision/beta/
model
ing
/'
,
'https://github.com/tensorflow/models/blob/master/
tensorflow_
model
s
/'
,
'The url prefix for links to code.'
)
'The url prefix for links to code.'
)
flags
.
DEFINE_bool
(
'search_hints'
,
True
,
flags
.
DEFINE_bool
(
'search_hints'
,
True
,
...
@@ -46,23 +47,47 @@ flags.DEFINE_bool('search_hints', True,
...
@@ -46,23 +47,47 @@ flags.DEFINE_bool('search_hints', True,
flags
.
DEFINE_string
(
'site_path'
,
'tfvision/api_docs/python'
,
flags
.
DEFINE_string
(
'site_path'
,
'tfvision/api_docs/python'
,
'Path prefix in the _toc.yaml'
)
'Path prefix in the _toc.yaml'
)
PROJECT_SHORT_NAME
=
'tfvision'
PROJECT_SHORT_NAME
=
'tf
m.
vision'
PROJECT_FULL_NAME
=
'TensorFlow Official Models - Vision Modeling Library'
PROJECT_FULL_NAME
=
'TensorFlow Official Models - Vision Modeling Library'
def
custom_filter
(
path
,
parent
,
children
):
if
len
(
path
)
==
1
:
# Don't filter the contents of the top level `tfm.vision` package.
return
children
else
:
return
public_api
.
explicit_package_contents_filter
(
path
,
parent
,
children
)
def
gen_api_docs
(
code_url_prefix
,
site_path
,
output_dir
,
project_short_name
,
def
gen_api_docs
(
code_url_prefix
,
site_path
,
output_dir
,
project_short_name
,
project_full_name
,
search_hints
):
project_full_name
,
search_hints
):
"""Generates api docs for the tensorflow docs package."""
"""Generates api docs for the tensorflow docs package."""
build_api_docs_lib
.
hide_module_model_and_layer_methods
()
build_api_docs_lib
.
hide_module_model_and_layer_methods
()
branch
=
code_url_prefix
.
strip
(
'/'
).
split
(
'/'
)[
-
2
]
official_url_prefix
=
(
f
'https://github.com/tensorflow/models/blob/
{
branch
}
/official/'
)
vision_base_dir
=
pathlib
.
Path
(
tfm
.
vision
.
__file__
).
parent
# The `layers` submodule (and others) are actually defined in the `official`
# package. Find the path to `official`.
official_base_dir
=
[
p
for
p
in
pathlib
.
Path
(
tfm
.
vision
.
layers
.
__file__
).
parents
if
p
.
name
==
'official'
][
0
]
doc_generator
=
generate_lib
.
DocGenerator
(
doc_generator
=
generate_lib
.
DocGenerator
(
root_title
=
project_full_name
,
root_title
=
project_full_name
,
py_modules
=
[(
project_short_name
,
tfvision
)],
py_modules
=
[(
project_short_name
,
tfm
.
vision
)],
base_dir
=
os
.
path
.
dirname
(
tfvision
.
__file__
),
base_dir
=
[
code_url_prefix
=
code_url_prefix
,
vision_base_dir
,
official_base_dir
,
],
code_url_prefix
=
[
code_url_prefix
,
official_url_prefix
],
search_hints
=
search_hints
,
search_hints
=
search_hints
,
site_path
=
site_path
,
site_path
=
site_path
,
callbacks
=
[
public_api
.
explicit_package_contents
_filter
],
callbacks
=
[
custom
_filter
],
)
)
doc_generator
.
build
(
output_dir
)
doc_generator
.
build
(
output_dir
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment