-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
docs/tutorials/gluon/hybrid.md
Outdated
@@ -105,23 +105,35 @@ Hybridize will speed up execution and save memory. If the top level layer is | |||
not a `HybridBlock`, you can still call `.hybridize()` on it and Gluon will try | |||
to hybridize its children layers instead. | |||
|
|||
`hybridize` also accepts many options for performance tuning. For example, you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many -> several?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piiswrong could you review this docs update as well? https://github.com/apache/incubator-mxnet/pull/11210/files thanks!
docs/tutorials/gluon/hybrid.md
Outdated
net.hybridize(static_alloc=True, static_shape=True) | ||
``` | ||
|
||
Please refer to [API manual](https://mxnet.incubator.apache.org/api/python/gluon/gluon.html?highlight=hybridize#mxnet.gluon.Block.hybridize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to the* API manual
python/mxnet/gluon/block.py
Outdated
@@ -600,6 +605,28 @@ def _summary_hook(block, _, outputs): | |||
class HybridBlock(Block): | |||
"""`HybridBlock` supports forwarding with both Symbol and NDArray. | |||
|
|||
`HybridBlock` is similar to `Block`, with a few differencies:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
differences*
python/mxnet/gluon/block.py
Outdated
model.initialize(ctx=mx.cpu(0)) | ||
model.hybridize() | ||
model(mx.nd.zeros((10, 10), ctx=mx.cpu(0))) | ||
|
||
Forward computation in :py:class:`HybridBlock` must be static to work with :py:class:`Symbol` s, | ||
i.e. you cannot call :py:meth:`NDArray.asnumpy`, :py:attr:`NDArray.shape`, | ||
:py:attr:`NDArray.dtype`, etc on tensors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NDArray-style indexing wouldn't work either in an HybridBlock. I think it is worth mentioning it.
* Improve hybridblock doc * fix
* Improve hybridblock doc * fix
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments