forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[numpy] Fix d2l chapter8 (apache#15237)
* Add np op doc * Fix several issues * Add a N-D dot b 2D support * Simplify array creation api * Add swapaxes * Fix rnn gluon * More fix * Fix pylint * Delete * Fix mp windows
- Loading branch information
Showing
24 changed files
with
549 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# pylint: skip-file | ||
|
||
"""Doc placeholder for numpy ops with prefix _np.""" | ||
|
||
|
||
def _np_reshape(a, newshape, order='C'): | ||
"""Gives a new shape to an array without changing its data. | ||
Parameters | ||
---------- | ||
a : ndarray | ||
Array to be reshaped. | ||
newshape : int or tuple of ints | ||
The new shape should be compatible with the original shape. If | ||
an integer, then the result will be a 1-D array of that length. | ||
One shape dimension can be -1. In this case, the value is | ||
inferred from the length of the array and remaining dimensions. | ||
order : {'C'}, optional | ||
Read the elements of `a` using this index order, and place the | ||
elements into the reshaped array using this index order. 'C' | ||
means to read / write the elements using C-like index order, | ||
with the last axis index changing fastest, back to the first | ||
axis index changing slowest. Other order types such as 'F'/'A' | ||
may be added in the future. | ||
Returns | ||
------- | ||
reshaped_array : ndarray | ||
It will be always a copy of the original array. This behavior is different | ||
from the official NumPy package where views of the original array may be | ||
generated. | ||
See Also | ||
-------- | ||
ndarray.reshape : Equivalent method. | ||
""" | ||
pass | ||
|
||
|
||
def _np_ones_like(a): | ||
"""Return an array of ones with the same shape and type as a given array. | ||
Parameters | ||
---------- | ||
a : ndarray | ||
The shape and data-type of `a` define these same attributes of | ||
the returned array. | ||
Returns | ||
------- | ||
out : ndarray | ||
Array of ones with the same shape and type as `a`. | ||
""" | ||
pass | ||
|
||
|
||
def _np_zeros_like(a): | ||
"""Return an array of zeros with the same shape and type as a given array. | ||
Parameters | ||
---------- | ||
a : ndarray | ||
The shape and data-type of `a` define these same attributes of | ||
the returned array. | ||
Returns | ||
------- | ||
out : ndarray | ||
Array of zeros with the same shape and type as `a`. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.