mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-mxnet] thomelane commented on a change in pull request #15343: Revise Symbol tutorial
Date Tue, 25 Jun 2019 17:22:33 GMT
thomelane commented on a change in pull request #15343: Revise Symbol tutorial
URL: https://github.com/apache/incubator-mxnet/pull/15343#discussion_r297299031
 
 

 ##########
 File path: docs/tutorials/basic/symbol.md
 ##########
 @@ -279,65 +243,48 @@ group.list_outputs()
 
 ## Relations to NDArray
 
-As you can see now, both `Symbol` and `NDArray` provide multi-dimensional array
-operations, such as `c = a + b` in MXNet. We briefly clarify the differences here.
+As you can see now, both `Symbol` and `NDArray` provide multi-dimensional array operations,
such as `c = a + b` in MXNet. We briefly clarify the differences here.
 
-The `NDArray` provides an imperative programming alike interface, in which the
-computations are evaluated sentence by sentence. While `Symbol` is closer to
-declarative programming, in which we first declare the computation and then
-evaluate with data. Examples in this category include regular expressions and
-SQL.
+The `NDArray` provides an imperative programming alike interface, in which the computations
are evaluated sentence by sentence. While `Symbol` is closer to declarative programming, in
which we first declare the computation and then evaluate with data. Examples in this category
include regular expressions and SQL.
 
 The pros for `NDArray`:
 
 - Straightforward.
-- Easy to work with native language features (for loop, if-else condition, ..)
-  and libraries (numpy, ..).
+- Easy to work with native language features (for loop, if-else condition, ..) and libraries
(numpy, ..).
 - Easy step-by-step code debugging.
 
 The pros for `Symbol`:
 
-- Provides almost all functionalities of NDArray, such as `+`, `*`, `sin`,
-  `reshape` etc.
+- Provides almost all functionalities of NDArray, such as `+`, `*`, `sin`, `reshape` etc.
 - Easy to save, load and visualize.
 - Easy for the backend to optimize the computation and memory usage.
 
 ## Symbol Manipulation
 
-One important difference of `Symbol` compared to `NDArray` is that we first
-declare the computation and then bind the computation with data to run.
-
-In this section, we introduce the functions to manipulate a symbol directly. But
-note that, most of them are wrapped by the high-level packages: `Module` and `Gluon`.
+One important difference of `Symbol` compared to `NDArray` is that we first declare the computation
and then bind the computation with data to run. In this section, we introduce the functions
to manipulate a symbol directly. But note that, most of them are wrapped by the high-level
packages: [Module](https://mxnet.incubator.apache.org/api/python/module/module.html) and [Gluon](https://mxnet.incubator.apache.org/api/python/gluon/gluon.html).
 
 ### Shape and Type Inference
 
-For each symbol, we can query its arguments, auxiliary states and outputs.
-We can also infer the output shape and type of the symbol given the known input
-shape or type of some arguments, which facilitates memory allocation.
+For each symbol, we can query its arguments, auxiliary states and outputs. We can also infer
the output shape and type of the symbol given the known input shape or type of some arguments,
which facilitates memory allocation.
 
 ```python
 arg_name = c.list_arguments()  # get the names of the inputs
 out_name = c.list_outputs()    # get the names of the outputs
 # infers output shape given the shape of input arguments
-arg_shape, out_shape, _ = c.infer_shape(a=(2,3), b=(2,3))
+arg_shape, out_shape, _ = c.infer_shape(a=(2, 3), b=(2, 3))
 # infers output type given the type of input arguments
 arg_type, out_type, _ = c.infer_type(a='float32', b='float32')
 {'input' : dict(zip(arg_name, arg_shape)),
- 'output' : dict(zip(out_name, out_shape))}
+'output' : dict(zip(out_name, out_shape))}
 
 Review comment:
   Would say the original style is better.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message