piyushghai commented on a change in pull request #13678: [MXNET-1260] Float64
DType computation support in Scala/Java
URL: https://github.com/apache/incubator-mxnet/pull/13678#discussion_r245448662
##########
File path: scala-package/core/src/main/scala/org/apache/mxnet/NDArray.scala
##########
@@ -262,16 +263,32 @@ object NDArray extends NDArrayBase {
arr
}
+ def full(shape: Shape, value: Double, ctx: Context): NDArray = {
+ val arr = empty(shape, ctx, DType.Float64)
+ arr.set(value)
+ arr
+ }
+
+ /**
+ * Create a new NDArray filled with given value, with specified shape.
+ * @param shape shape of the NDArray.
+ * @param value value to be filled with
+ */
+ def full(shape: Shape, value: Double): NDArray = {
+ full(shape, value, null)
+ }
+
+
// Perform power operator
def power(lhs: NDArray, rhs: NDArray): NDArray = {
NDArray.genericNDArrayFunctionInvoke("_power", Seq(lhs, rhs))
}
- def power(lhs: NDArray, rhs: Float): NDArray = {
+ def power(lhs: NDArray, rhs: MX_PRIMITIVE_TYPE): NDArray = {
Review comment:
Done in commit : 55537dcf6f45adea5a0f559775a0632b974ceb1f
----------------------------------------------------------------
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