You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mxnet.apache.org by "Naveen Swamy (JIRA)" <ji...@apache.org> on 2018/11/26 19:39:00 UTC

[jira] [Comment Edited] (MXNET-1231) Help user make some as optional field

    [ https://issues.apache.org/jira/browse/MXNET-1231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16699473#comment-16699473 ] 

Naveen Swamy edited comment on MXNET-1231 at 11/26/18 7:38 PM:
---------------------------------------------------------------

As discussed offline, one option is to create implicit def for all data types:

```

// use generics, below is for illustration only

implicit def StringToSomeString(x: String): Option[String] =

{ Some(x) }

implicit def SomeStringToString(x: Option[String]): String =

{ x.get }

```


was (Author: nswamy@apache.org):
As discussed offline, one option is to create implicit def for all data types:

```

// use generics, below is for illustration only

implicit def StringToSomeString: scala.Option[String](x: String) = {

Some(x)

}

implicit def SomeStringToString(x: Option[String]): String = {

x.get

}

```

> Help user make some as optional field
> -------------------------------------
>
>                 Key: MXNET-1231
>                 URL: https://issues.apache.org/jira/browse/MXNET-1231
>             Project: Apache MXNet
>          Issue Type: Improvement
>          Components: Apache MXNet Scala API
>            Reporter: Qing Lan
>            Priority: Major
>
> Currently, the usage of some in api.<function_name> is pretty awful, users have to do Some(Symbol) and then .get to use the arithmetic method and then wrapped up using another Some() to make it pass to the next layer. We should figure out a way to simplify the process.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org