taliesinb commented on a change in pull request #12064: Allow stop of arange to
be inferred from dims.
URL: https://github.com/apache/incubator-mxnet/pull/12064#discussion_r211408234
##########
File path: contrib/clojure-package/src/org/apache/clojure_mxnet/symbol.clj
##########
@@ -135,7 +135,17 @@
([start stop {:keys [step repeat dtype]
:or {step (float 1) repeat (int 1) dtype base/MX_REAL_TYPE}
:as opts}]
- (Symbol/arange (float start) ($/option (float stop)) step repeat nil dtype))
+ (Symbol/arange (float start) ($/option (float stop)) step repeat false nil
dtype))
+ ([start stop]
+ (arange start stop {})))
+
+(defn arange-with-inference
+ "Behaves like arange operator, but infers the stop value from the output
shape,
Review comment:
@nswamy I'm now skeptical of my Scala changes. For example, I'm not sure
that the additions to `arange` in `NDArray.scala` are correct. My concern is
that the only way that you can even use the new inference feature is via
backward inference, because the inference is based on the output shape of the
tensor produced by `arange`, which must be inferred from a different part of
the graph. So unless I'm missing something, calling the `arange` function with
`infer_range = true` will always fail as it has to produce an `NDArray`
*immediately*, but this is not possible because backward inference is only
relevant for symbols.
The new functionality should work in the symbolic context, however.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services