Commit Graph
102 Commits
Author SHA1 Message Date
Zach Boldyga e37ff53f0a Return value docs for nd.random.* and sym.random.* (#13994)
* mx.random.multinomial python documentation updated, return type details added

* multinomial documentation clarified

* added basic case for negative_binomial

* added basic case for generalized_negative_binomial

* basic case added for gamma

* added basic case for exponential

* basic case added for randn

* remaining base cases added.

* randint case added

* cleaned up return types for random.py

* zboldyga added to contributors

* spacing typo correction

* updated symbol.random return types, minor correction to ndarray.random return types

* removed trailing whitespace in docs
2019-01-29 17:54:57 -08:00
HyperZealot 45d1a1e6ff split_v2 (#13687) 2019-01-23 13:09:33 -08:00
Anirudh Subramanian 9ce7eabcbc Fix warning in waitall doc (#13618) 2018-12-11 17:22:02 -08:00
Anirudh Subramanian 7d2b804823 Fix exception handling api doc (#13519)
* Fix exception handling api doc

* Update waitall api doc

Co-Authored-By: anirudh2290 <anirudh2290@apache.org>
2018-12-07 19:46:57 -08:00
Chaitanya Prakash Bapat e0ff3c36ee Updated docs for randint operator (#13541)
* updated docs for randint

* added randint in __all__ and reordered acc to categorical then alphabetical

* Trigger CI

* minus mxnet.symbol and alphabetical for ndarray,symbol.md

* alphabetical order
2018-12-05 21:58:19 -08:00
Chaitanya Prakash Bapat 8a94dbd376 [MXNET-1029] Feature request: randint operator (#12749)
* randint operator add along with add optional tag to params

* register param

* lint space issue

* randn issue fix

* uniform_int_distribution doesn't support int8, uint8 fix

* dtype ftype

* ftype to dtype - invalid template arg

* fix template arg issue

* test with int dtype for windows

* removed int8,uint8 from test

* gpu implementation

* gpu engine state diff

* removed gpu support

* empty commit

* temporary fix : batchnorm flaky test skip

* removed randn symbol specific code since other PR is on it

* revert ndarray/randn for compatibility

* added unit test for checking extremes and uniform distribution for sufficient samples

* increased the high val

* int32 to int64 support, indentation fix, check for optype correctly based on type of random function

* gpu support, revert finfertype using template specialization, remove defaults, prints, test other low high val

* fix for invalid template arg by checking for int32,int64

* gpu randint in random_generator

* sample_uniform issue and param, removed old flaky test skip line

* replaced discrete_uniform function by rand_int64 for consistency

* formula update and removed itype

* change ctx to include gpu, randint samepl_op.cu typo

* trigger ci

* doc fix, check fix, whitespace remove

* added the without dtype testcase
2018-11-27 13:31:44 -08:00
Rakesh Vasudevan 1aa6a38390 Made fixes to sparse.py and sparse.md (#13305) 2018-11-16 16:46:50 -08:00
vdantu 02592544ce Addressed doc issues (#13165)
* Addressed doc issues

* Update optimizer.py
2018-11-15 12:58:50 -08:00
Roshani Nagmote 6d5e3cb42e Fix Sphinx python docstrings (#13160)
* Doc fixes

* addressing feedback

* base_module fix

* fixing cross-reference issues
2018-11-13 09:14:47 -08:00
vdantu 3c5fa16d6f Revert "Sphinx failure fixes" (#13230)
* Revert "Refactor kvstore test (#13140)"

This reverts commit d8d2d6ef3d.

* Revert "[MXNET-793] Virtualized ARMv7 with Qemu CI integration (#13203)"

This reverts commit fd3dedc621.

* Revert "Sphinx failure fixes (#13213)"

This reverts commit 2e4d6c8c10.
2018-11-12 14:38:07 -08:00
vdantu 2e4d6c8c10 Sphinx failure fixes (#13213) 2018-11-11 23:50:38 -08:00
Rakesh Vasudevan 6ab06e6d0c Fixed Sparse astype doc string formatting error (#13171) 2018-11-09 22:57:56 -08:00
Frank Liu 24b8de0825 Fix #13013, Fix Sphinx python docstring error. (#13173) 2018-11-08 21:13:00 -08:00
JackieWu 974a04cdb9 Fix example for mxnet.nd.contrib.cond and fix typo in src/engine (#12954)
* fix typo in src/engine

* fix example for mx.nd.contrib.cond
2018-11-04 09:57:32 -08:00
Chaitanya Prakash Bapat a362df1eb1 [MXNET-1173] Debug operators - isfinite, isinf and isnan (#12967)
* is_finite and is_inf implementation for front-end python api debug operator

* updated unit-tests

* updated test cases and incorporated is_nan function

* solved index out of bounds issue and added comments

* simplified abs function call and added isnan to contrib.py and all debug ops to doc

* changed dimensions, added regular number, assert_equal instead of almost, removed ctx and added data.abs
2018-10-29 11:25:47 -07:00
Aaron Markham 76d5197b42 add/update infer_range docs (#12879) 2018-10-19 17:43:41 -07:00
Chaitanya Prakash Bapat c90d16c192 Fix mismatch shapes (#12793)
* mismatch shape switch

* closing bracket

* closing bracket
2018-10-12 15:14:58 -07:00
Alex Rogozhnikov be0c6efed5 Fix #12672, importing numpy scalars (zero-dimensional arrays) (#12678)
* Fix https://github.com/apache/incubator-mxnet/issues/12672

Problem is in using np.ascontiguousarray,
which is buggy for zero-dimensional arrays
 (see https://github.com/numpy/numpy/issues/5300 for details).

Here I use the solution proposed by numpy team:
switch to asarray with order='C'.

Add some tests for this situation (for array() and for setitem too).

* typo in tests
2018-10-04 13:23:28 -07:00
JackieWu 9f14a68045 [MXNET-779]Add DLPack Transformation API (#12047) 2018-09-21 20:33:33 -07:00
Sheng Zha dd55b2b7ba add fluent methods for softmin (#12605) 2018-09-20 02:59:01 +02:00
cclauss 2276bb0e30 Tighten up PyLint directives again (#12322)
* Tighten up PyLint directives again

* Disable too-many-locals

* Doubly disable too-many-locals
2018-08-24 18:19:56 +02:00
Taliesin Beynon 7bfe42786f Allow stop of arange to be inferred from dims. (#12064)
* Allow stop of arange to be inferred from dims.

Enabled via a flag.

* modify NDArray/Symbol to add infer_range param

* Add test for arange-with-inference.

* Add a comment to readme about JDK 8.

* Fix approx=.

Include a test of this fix as well.
2018-08-24 09:00:13 -07:00
Alexander Zai 1ffb3f58a3 Add randn to random module (#12156)
* add randn to random

* reorder args

* update comments

* add test for randn

* fix ordering of params

* update test name

* fix params

* remove dup param

* restrict loc and scale for randn method

* test should only use single loc / scale

* pop out kwargs

* fix lint

* use normal symbol from randn test

* update randn test

* retrigger
2018-08-22 18:14:19 -07:00
Vandana Kannan 76bdc8772c [MXNET-696] Fix undefined name and enable Pylint undefined variable (#12277)
* Fix infinite loop in retain

* Enable undefined variable in pylint
2018-08-22 14:42:29 -07:00
Da Zheng 902c579982 Make the output format of control flow operators consistent with their UDFs (#12209)
* always return a list in foreach.

* update tests.

* Revert "update tests."

This reverts commit d5d3656a79011b402f760981705d83b187a7cea0.

* make the loop output consistent with the UDF output.

* make cond consistent.

* fix lint.

* fix messages.

* check foreach states.

* allow foreach states to be a symbol or a list of symbols.

* support a symbol or a list for while loop states.

* fix lint.

* support nested list in foreach.

* support nested list in while.

* fix lint

* update doc.

* fix.

* retrigger

* fix.

* update doc.
2018-08-22 13:10:00 -07:00
cclauss aec7d2c0a7 Python fixes for PyLint test "consider-using-in" (#12214)
* PyLint fixes for consider-using-in

* Add missing 'in'
2018-08-20 09:47:46 -07:00
Vandana Kannan f6d594b7c7 Fix undefined name in __init__ (#12207) 2018-08-17 08:36:32 -07:00
access2rohit c13ce5cb0a [MXNET-378] Adding depth_to_space and space_to_depth operator(Updated) (#11587)
* [MXNET-378] Adding depth_to_space and space_to_depth operator

* fixed lint and windows CPU errors

* compliance with C++ style guiide and address shortcomings in unittests

* fixed documentation and nitpicky suggestions

* added operator references in API docs and removed inplace optimization support

* Added references in symbol.md and ndarray.md. Improved test cases and added block_size check

* Fixing bugs in documentation. Tests now include tensors of random shapes.
2018-07-26 13:44:23 -07:00
Junru Shao 4bb141d682 [MXNET-684] Add cond operator (#11760)
* Initial commit for `Ifelse`

* Address comments

* Rename ifelse to condition

* API change

* Trigger CI

* Rename condition to cond

* Fix lint
2018-07-23 21:18:17 -07:00
Istvan Fehervari b16f87505a [MXNET-524] Broadcast like operator (#11820)
* Registered the broadcast_like operator with GPU and CPU

Added appropriate shape inference

* Added python interface to ndarray and symbol

* Added python api documentation

* Fixed backward operation

* Added unit tests

* Fixed linting issues

* Added missing api doc
2018-07-20 09:56:16 -07:00
Istvan Fehervari f15b1b88b9 Added the diag() operator (#11643)
* Added np.diag as mxnet operator, WIP

Done:
2d input forward pass
Missing:
1d input forward
all backward

* Added a simple gradient transfer backwards operator for diag

Fixed small typos as well

* Finished backward operation

* Added full support for k

* Finished added the 1D case to the diag operator

Finished function documentation
Added unit tests

* Fixed cpplinter errors in the diag operator

Issues were extra white spaces and include order

* Fixed indentation in diag_op-inl.h

* Changed diag operator tests to use np.diag() as comparison

* Fixed kernel bug in gpu diag operator

* Replaced the min operator with an inline if statement.

* Added diag to ndarray and symbol

* Replaced the type of parameter k from int32 to nnvm::dim

* Added default argument to k in ndarray and symbol

* Fixed ndarray and symbol diag calls

* Fixed the optional k parameter

* Fixed cpp linting error

* Changed test data datatype to float32

* K values resulting into 0-sized diagonals will now throw an exception.

Added matching test case

* Fixed unittest

* Added diag to NDArray and Symbol api doc

* Added missing api doc
2018-07-19 13:26:46 -07:00
Junru Shao 54632bcb38 [MXNET-626] Add while_loop (#11566)
* Add while_loop

* Avoid input/output overlap for nnvm graph cut

* Add more testcases

* Enhance test 4.2

* Add more complicated testcases; Add testcase for nested loop

* Check unused loop_vars in while_loop

* Add testcases for RNN

* Make lint happy

* Make lint happy

* Address TODOs

* Fix flaky test for while_loop

* Address comments

* Improve docstring

* Improve error message

* Add benchmark code

* Update benchmarks

* Allow sparse types

* Make max_iterations default to None

* Add while_loop to docs/api/python/{symbol|ndarray}/contrib.md

* Pad imperative while_loop so that it has the same shape with the symbolic one

* Add example result into the example section

* Remove unused class member

* Rename unittest to test_contrib_control_flow.py

* Update docstring

* Update docstring

* Trigger CI

* Change threshold for assert_almost_equal

* Trigger CI

* Address comments from szha

* Rewrite benchmark code

* Fix sphinx warning
2018-07-18 17:09:10 -07:00
Da Zheng 030fbc3c7b [MXNET-432] Add Foreach (#11531)
* Test input a graph.

* Update foreach to execute the subgraph.

* print inputs/outputs in foreach.

* Remove print.

* add test code for foreach.

* exec foreach outside the engine.

* Implements forward of foreach.

* Add support for variable numbers of inputs and outputs.

* Add a python wrapper for foreach.

* Fix the order of inputs.

* add test with lstm.

* hide C version of foreach.

* fix a bug temporarily.

* Test free variables.

* change for the new interface of InputGraph attribute.

* Add attribute to the subgraph.

* Handle free variables.

* Get all input symbols of a subgraph.

* Fix shape, dtype and storage inference.

* reorganize the output of foreach.

* Add a gluon RNN unroll with symbol foreach.

* print unnecessary print.

* have imperative and symbolic foreach.

* Fix an error after moving foreach.

* Fix imperative foreach

* Fix a minor problem.

* Use CachedOp to execute subgraph.

* update TODO.

* make foreach op use FStatefulComputeEx.

TODO we need to change stateful executor to handle subgraph.

* Add backward.

* Fix bugs.

* enable backward test in lstm.

* Fix a bug in foreach backward for free variables.

* change for the new CachedOp.

* Detect the backward computation.

* Fix bugs in foreach.

* fix tests.

* update tests.

* check state shape.

* enable nested foreach.

* remove print.

* fix a bug in test.

* handle infer storage type for backward.

* address comments.

* address comments.

* move some common functions out.

* address comments.

* fix lint.

* Fix lint.

* add doc.

* undo modification in imperative.h

* add doc and remove example code.

* fix lint.

* fix lint.

* Fix lint.

* make nd.foreach and sym.foreach consistent.

* fix compile error.

* address comments.

* update.

* check for loop only works for dense arrays.

* move control flow op out of nn/

* fix include.

* add a test in gluon.

* work for GPU.

* small fix.

* remove subgraph_name

* create loop state for reuse in the future.

* move code.

* Revert "remove subgraph_name"

This reverts commit 977f5624ad0b0dedb9dcb8629f975afc56bb1e1a.

* cut graph.

* rename new var nodes.

* Fix tests.

* Fix bugs caused by ctypes (#29)

* Add save/load json in testcases for foreach (#30)

* support subgraph in stateful executor.

* Fix compilation.

* fix a bug when a subgraph has variable nodes.

* Fix a bug of getting symbols.

* copy var nodes.

* Fix getting op states.

* fix lint error.

* address comments.

* fix lint error.

* simplify the execution of subgraph in the main thread.

* fix lint error.

* avoid waiting for computation in each iteration.

* reuse cached op for inference.

* share memory across mini-batches.

* reuse memory.

reuse memory between iterations in inference.
reuse memory between mini-batches in training.

* add tests for multiple batches.

* remove entry.

* add benchmark for foreach.

* benchmark large batch size.

* Fix the benchmark for GPU.

* address comments.

* update shape/dtype/storage inference.

* update contrib API docs.

* support nested foreach.

* use a single CachedOp for all iterations.

* use large dim.

* update benchmark.

* update benchmark.

* update benchmark.

* update benchmark.

* return symbol arrays correctly in MXSymbolCutSubgraph.

* return symbol arrays in MXSymbolGetInputSymbols.

* fix lint error.

* use cachedop to infer storage in backward.

* fix scala API.

* update comments.

* fix scala.

* fix test.

* fix attribute name.

* move benchmark.

* fix the mapping of operator inputs/outputs and subgraph inputs/outputs.

* add tests for dtype/shape inference.

* reorganize tests.

* fix a bug of cutting NodeEntry.

When two node entries refer to the same output of a node, we should
create only one var node for these two node entries.

* fix lint error.

* handle the case that outputs are inputs.

* handle the case that inputs aren't used.

* handle the case without output data.

* fix a bug in foreach backward.

* fix a bug when there isn't output data.

* Fix lint error.

* test diff Gluon RNN cells.

* test all symbol RNN cells.

* adjust the test precision.

* Fix a bug in getting a list of variable names.

We can't get a list of variable names from a hashtable. The order can't
be guaranteed. Python2 and Python3 output different orders.

* fix lint error.

* Test 1D array.

* fix a bug when subgraph inputs and outputs share NDArray.

* fix.

* fix

* add comments.
2018-07-02 15:26:51 -07:00
Anirudh 33022f82a3 [MXNET-382] Shape and Size Operator (#10889)
* Shape Operator

* cuda

* size op

* lint issues

* docs example

* add docs, change op name to avoid conflict, add convenience confluent
method

* change name to _nd

* fix test cases, add new kernel

* test name fix.

* solve gpu memory problem for size and shape

* get rid of FIgnoreInputs attr of shape_nd

* op name change

* fix

* retrigger CI

* retrigger CI

* retrigger CI

* trigger CI

* fix comments

* cpplint

* nit

* trigger CI
2018-06-29 18:05:38 -07:00
Haibin Lin 3ff7bf72e0 Update contrib.py (#11447) 2018-06-28 16:32:00 -07:00
Hao Jin ed7e3602a8 [MXNET-349] Histogram Operator (#10931)
* implementation of histogram operator

* address code reviews and code re-design

* add exception for invalid inputs

* address code reviews

* add symbol and symbolic forward check for histogram
2018-06-25 16:45:32 -07:00
Deokjae Lee a27b52e966 [MXNET-424] dtype option for multinomial (#10970)
* dtype option for multinomial

* Add missing test for uint8

* Add check to ensure dtype has a sufficient precision.

* Fix lint

* Error message for the dtype precision check

* Retrigger CI
2018-06-01 12:35:23 -07:00
Ziyue Huang 0fcf191760 Fix eye doc (#10908)
* fix eye doc

* fix
2018-05-11 15:52:04 -07:00
Anirudh Subramanian 86ee3e119a Change class variables to thread local variables (#10833)
* Change to simpler implementation

* Add property

* Remove pdb

* Add support for setter and getter

* fix issues

* Add warnings

* Add thread local unittest and tlocal race condition

* Fix pylint

* Use current_context instead of _default_ctx

* Use current_context

* Fix race condition

* Fix thread local test

* Change to current_context
2018-05-11 11:06:52 -07:00
reminisce 333e7fef64 [MXNET-407] Better error handling of NDArray setitem autograd (#10844)
* Initial commit

* More fix
2018-05-09 10:58:31 -07:00
Sheng Zha 66b294434a add reverse option to ndarray inplace reshape (#10767)
* add reverse option to ndarray inplace reshape

* update check
2018-05-03 10:16:48 -07:00
Anirudh 61f86fcfdc [MXNET-347] Logical Operators AND, XOR, OR (#10679)
* logical and

* logical OR and XOR operators.

* better examples

* nits.

* elemwise operators

* non broadcast examples and tests.

* doc API

* rerun CI
2018-05-01 09:43:38 -07:00
Haibin Lin a8e1912b59 Fix typo in __setitem__ doc (#10657) 2018-04-24 10:28:48 -07:00
daquexian f220ad07bb Fix typo in image.py (#10540)
Fix typo in image.py
2018-04-13 10:15:10 -07:00
Joshua Z. Zhang 549fd64518 [MXNET-306] Add slice_like operator (#10491)
* add slice_like and doc

* pass unittest and lint
2018-04-11 15:02:59 -07:00
Deokjae Lee ed7077af3e [MXNET-300] Fix ndarray assignment bug with index -1 (#10468)
* Fix ndarray assignment bug with index -1

* Add test cases for negative index
2018-04-10 10:26:26 -07:00
Deokjae Lee 6f6a1dc4d3 [MXNET-291] Fix an ndarray indexing bug with index -1 (#10440)
* Fix an ndarray indexing bug with index -1

* Add tests for ndarray slicing with negative index

* Test revise
2018-04-06 16:14:35 -07:00
Deokjae Lee 2ae0bd598b Fix typos in random number docs (#10423) 2018-04-05 15:20:16 -07:00
Hao Jin 73a0eb00c6 [MXNET-117] Sparse operator broadcast_mul/div(csr, dense) = csr (#10208)
* support broadcast_mul/div(csr, 1Ddense) = csr

* address code reviews and support broadcast_mul/div(csr, 2Ddense) = csr

* add test for both 1D and 2D dense case

* address code review and fix test error

* address code review and fix test error

* added proper overrides for basic arithmetic functions for sparse tensors.

* fix broadcast dimension

* address code reviews
2018-04-05 12:46:51 -07:00
Sheng Zha 9fee414882 extend ndarray in-place reshape (#10360)
* refactor reshapeshape

* add extended reshape to c_api

* fix for windows

* avoid arr buf for windows

* update
2018-04-03 23:07:22 -07:00