Skip to content

Commit

Permalink
add api docs (#3483)
Browse files Browse the repository at this point in the history
* add api docs

* fix docs

* add api doc in math_ops

* Change the theme to read_the_docs

* add equation docs in math_add

* add equation docs in sub, mul, addn

* add mod div tanh docs

* add gelu, relu docs

* add sigmoid unsorted_segment_sum api docs

* add unsorted_segment example docs

* add equal to greate_equal example docs

* add logical and example docs

* add other example docs, include squared difference

* add requirements of sphinx_rtd_theme

* delete the requirement of sphinx-material

* use make of format

Co-authored-by: doombeaker <[email protected]>
Co-authored-by: Shenghang Tsai <[email protected]>
Co-authored-by: oneflow-bot <[email protected]>
Former-commit-id: 3a1ef10
  • Loading branch information
4 people authored Aug 20, 2020
1 parent b4e377b commit dad8a77
Show file tree
Hide file tree
Showing 5 changed files with 925 additions and 174 deletions.
2 changes: 1 addition & 1 deletion docker/ci/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pycocotools
opencv-python==4.2.0.34
sphinx
sphinx-material
recommonmark
scipy
pillow
sphinx_rtd_theme
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_material"
html_theme = "sphinx_rtd_theme"

# Material theme options (see theme.conf for more information)
html_theme_options = {
Expand Down
12 changes: 6 additions & 6 deletions oneflow/python/ops/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def dense(
activation (Optional[remote_blob_util.BlobDef], optional): Activation function. Defaults to None.
use_bias (bool, optional): A boolean specifies whether to use a bias vector. Defaults to True.
kernel_initializer (Optional[op_conf_util.InitializerConf], optional): Initializer for the kernel weights matrix. Defaults to None.
bias_initializer (Optional[op_conf_util.InitializerConf], optional): [description]. Defaults to None.
kernel_regularizer (Optional[op_conf_util.RegularizerConf], optional): [description]. Defaults to None.
bias_initializer (Optional[op_conf_util.InitializerConf], optional): Initializer for the bias vector. Defaults to None.
kernel_regularizer (Optional[op_conf_util.RegularizerConf], optional): Regularizer function applied to the kernel weights matrix. Defaults to None.
bias_regularizer (Optional[op_conf_util.RegularizerConf], optional): Regularizer for the bias vector. Defaults to None.
trainable (bool, optional): A boolean specifies whether to train the variables. Defaults to True.
name (Optional[str], optional): This layer's name. Defaults to None.
Expand Down Expand Up @@ -646,7 +646,7 @@ def layer_norm(
begin_norm_axis (int, optional): An integer specifies which axis to normalize at first. Defaults to 1.
begin_params_axis (int, optional): An integer specifies which axis params at . Defaults to -1.
epsilon (float, optional): A small float is added to avoid division by zero. Defaults to 1e-5.
name (Optional[str], optional): This layer's name. Defaults to None.
name (Optional[str], optional): This layer's name. Defaults to None.
Returns:
remote_blob_util.BlobDef: A normalized `Blob` with same shape of input.
Expand Down Expand Up @@ -1004,18 +1004,18 @@ def upsample(
Args:
x ([type]): Input `Blob`.
size (tuple, optional): (height_scale,width_scale) Defaults to (2, 2).
size (tuple, optional): (height_scale, width_scale) Defaults to (2, 2).
data_format (str, optional): A string specifies the format of the input `Blob`, one of "NCHW" or "NHWC" (default: "NCHW"). "NCHW" cooresponds to channels_first, i.e. the input `Blob` with shape (batch_size, channels, height, width).
"NHWC" cooresponds to channels_last, i.e. the input `Blob` with shape (batch_size, height, width, channels).. Defaults to "NCHW".
interpolation (str, optional): Image interpolation algorithm to enlarge the image size. Defaults to "nearest".
interpolation (str, optional): Image interpolation algorithm to enlarge the image size. Defaults to "nearest". "nearest" and "bilinear" are available now.
name ([type], optional): This layer's name. Defaults to None.
Raises:
ValueError: interpolation must be "nearest" or "bilinear".
ValueError: data_format must be "NHWC" or "NCHW"
Returns:
[type]: remote_blob_util.BlobDef: A `Blob` with new shape of input. if input size is(2,2),then the new shape is [N, C, 2H, 2W].
[type]: remote_blob_util.BlobDef: A `Blob` which is the upsampled `x`. If `size` is (2, 2), the shape of return value is [N, C, 2H, 2W].
"""
if isinstance(size, int):
height_scale = size
Expand Down
Loading

0 comments on commit dad8a77

Please sign in to comment.