Class/Object

ml.dmlc.mxnet

Symbol

Related Docs: object Symbol | package mxnet

Permalink

class Symbol extends AnyRef

Symbolic configuration API of mxnet.
WARNING: it is your responsibility to clear this object through dispose(). NEVER rely on the GC strategy

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Symbol
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def %[V](other: V): Symbol

    Permalink
  4. def %(other: Symbol): Symbol

    Permalink
  5. def *[V](other: V): Symbol

    Permalink
  6. def *(other: Symbol): Symbol

    Permalink
  7. def **[V](other: V): Symbol

    Permalink
  8. def **(other: Symbol): Symbol

    Permalink
  9. def +[V](other: V): Symbol

    Permalink
  10. def +(other: Symbol): Symbol

    Permalink
  11. def -[V](other: V): Symbol

    Permalink
  12. def -(other: Symbol): Symbol

    Permalink
  13. def /[V](other: V): Symbol

    Permalink
  14. def /(other: Symbol): Symbol

    Permalink
  15. def <[V](other: V): Symbol

    Permalink
  16. def <(other: Symbol): Symbol

    Permalink
  17. def <=[V](other: V): Symbol

    Permalink
  18. def <=(other: Symbol): Symbol

    Permalink
  19. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  20. def >[V](other: V): Symbol

    Permalink
  21. def >(other: Symbol): Symbol

    Permalink
  22. def >=[V](other: V): Symbol

    Permalink
  23. def >=(other: Symbol): Symbol

    Permalink
  24. def apply(name: String, symbols: Map[String, Symbol]): Symbol

    Permalink

    Invoke symbol as function on inputs.

    Invoke symbol as function on inputs.

    name

    resulting symbol name

    symbols

    provide named symbols

    returns

    the resulting symbol

  25. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  26. def attr(key: String): Option[String]

    Permalink

    Get attribute string from the symbol, this function only works for non-grouped symbol.

    Get attribute string from the symbol, this function only works for non-grouped symbol.

    key

    The key to get attribute from.

    returns

    value The attribute value of the key, returns None if attribute do not exist.

  27. def attrMap(): Map[String, Map[String, String]]

    Permalink

    Recursively gets all attributes from the symbol and its children.

    Recursively gets all attributes from the symbol and its children.

    returns

    Map[Map[String, String]], There is a key in the returned dict for every child with non-empty attribute set. For each symbol, the name of the symbol is its key in the dict and the correspond value is that symbol's attribute list (itself a dictionary).

  28. def bind(ctx: Context, args: Map[String, NDArray]): Executor

    Permalink
  29. def bind(ctx: Context, args: Seq[NDArray]): Executor

    Permalink
  30. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray]): Executor

    Permalink
  31. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray]): Executor

    Permalink
  32. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray]): Executor

    Permalink
  33. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray]): Executor

    Permalink
  34. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradsReq: Map[String, String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  35. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradsReq: Map[String, String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  36. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradsReq: Map[String, String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  37. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradsReq: Map[String, String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  38. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradsReq: Map[String, String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  39. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradsReq: Map[String, String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  40. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradsReq: Map[String, String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  41. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradsReq: Map[String, String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  42. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradsReq: Seq[String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  43. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradsReq: Seq[String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  44. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradsReq: Seq[String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  45. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradsReq: Seq[String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  46. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradsReq: Seq[String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  47. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradsReq: Seq[String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  48. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradsReq: Seq[String], auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  49. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradsReq: Seq[String], auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  50. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradReq: String, auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  51. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Map[String, NDArray], gradReq: String, auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  52. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradReq: String, auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  53. def bind(ctx: Context, args: Map[String, NDArray], argsGrad: Seq[NDArray], gradReq: String, auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  54. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradReq: String, auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  55. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Map[String, NDArray], gradReq: String, auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  56. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradReq: String, auxStates: Map[String, NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink
  57. def bind(ctx: Context, args: Seq[NDArray], argsGrad: Seq[NDArray], gradReq: String, auxStates: Seq[NDArray], group2ctx: Map[String, Context], sharedExec: Executor): Executor

    Permalink

    Bind current symbol to get an executor.

    Bind current symbol to get an executor.

    ctx

    Context The device context the generated executor to run on.

    args

    Input arguments to the symbol.

    • If type is list of NDArray, the position is in the same order of list_arguments.
    • If type is dict of str to NDArray, then it maps the name of arguments to the corresponding NDArray.
    • In either case, all the arguments must be provided.
    argsGrad

    When specified, args_grad provide NDArrays to hold the result of gradient value in backward.

    • If type is list of NDArray, the position is in the same order of list_arguments.
    • If type is dict of str to NDArray, then it maps the name of arguments to the corresponding NDArray.
    • When the type is dict of str to NDArray, users only need to provide the dict for needed argument gradient. Only the specified argument gradient will be calculated.
    gradReq

    {'write', 'add', 'null'}, or list of str or dict of str to str, optional Specifies how we should update the gradient to the args_grad.

    • 'write' means everytime gradient is write to specified args_grad NDArray.
    • 'add' means everytime gradient is add to the specified NDArray.
    • 'null' means no action is taken, the gradient may not be calculated.
    auxStates

    Input auxiliary states to the symbol, only need to specify when list_auxiliary_states is not empty.

    • If type is list of NDArray, the position is in the same order of listAuxiliaryStates
    • If type is dict of str to NDArray, then it maps the name of auxiliary_states to the corresponding NDArray,
    • In either case, all the auxiliary_states need to be provided.
    group2ctx

    The dict mapping the ctx_group attribute to the context assignment.

    sharedExec

    Executor to share memory with.

    • This is intended for runtime reshaping, variable length sequences, etc.
    • The returned executor shares state with shared_exec, and should not be used in parallel with it.
    returns

    The generated Executor

    Note

    Auxiliary states are special states of symbols that do not corresponds to an argument, and do not have gradient. But still be useful for the specific operations. A common example of auxiliary state is the moving_mean and moving_variance in BatchNorm. Most operators do not have auxiliary states and this parameter can be safely ignored. User can give up gradient by using a dict in args_grad and only specify gradient they interested in.

  58. def clone(): Symbol

    Permalink
    Definition Classes
    Symbol → AnyRef
  59. def debugStr: String

    Permalink

    Get a debug string.

    Get a debug string.

    returns

    Debug string of the symbol.

  60. def dispose(): Unit

    Permalink

    Release the native memory.

    Release the native memory. The object shall never be used after it is disposed.

  61. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  62. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  63. def finalize(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Symbol → AnyRef
  64. def get(name: String): Symbol

    Permalink
  65. def get(index: Int): Symbol

    Permalink
  66. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  67. def getInternals(): Symbol

    Permalink

    Get a new grouped symbol whose output contains all the internal outputs of this symbol.

    Get a new grouped symbol whose output contains all the internal outputs of this symbol.

    returns

    The internal of the symbol.

  68. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  69. def inferShape(keys: Array[String], indPtr: Array[Int], values: Array[Int]): (IndexedSeq[Shape], IndexedSeq[Shape], IndexedSeq[Shape])

    Permalink
  70. def inferShape(kwargs: Map[String, Shape]): (IndexedSeq[Shape], IndexedSeq[Shape], IndexedSeq[Shape])

    Permalink

    Infer the shape of outputs and arguments of given known shapes of arguments.

    Infer the shape of outputs and arguments of given known shapes of arguments. User can either pass in the known shapes in positional way or keyword argument way. Tuple of Nones is returned if there is not enough information passed in. An error will be raised if there is inconsistency found in the known shapes passed in.

    kwargs

    Provide keyword arguments of known shapes.

    returns

    argShapes List of shapes of arguments. The order is in the same order as list_arguments() outShapes List of shapes of outputs. The order is in the same order as list_outputs() auxShapes List of shapes of outputs. The order is in the same order as list_auxiliary()

  71. def inferShape(args: Shape*): (IndexedSeq[Shape], IndexedSeq[Shape], IndexedSeq[Shape])

    Permalink

    Infer the shape of outputs and arguments of given known shapes of arguments.

    Infer the shape of outputs and arguments of given known shapes of arguments. User can either pass in the known shapes in positional way or keyword argument way. Tuple of Nones is returned if there is not enough information passed in. An error will be raised if there is inconsistency found in the known shapes passed in.

    args

    Provide shape of arguments in a positional way. Unknown shape can be marked as None

    returns

    argShapes List of shapes of arguments. The order is in the same order as list_arguments() outShapes List of shapes of outputs. The order is in the same order as list_outputs() auxShapes List of shapes of outputs. The order is in the same order as list_auxiliary()

  72. def inferType(kwargs: Map[String, DType]): (Seq[DType], Seq[DType], Seq[DType])

    Permalink

    Infer the type of outputs and arguments of given known types of arguments.

    Infer the type of outputs and arguments of given known types of arguments. Tuple of Nones is returned if there is not enough information passed in. An error will be raised if there is inconsistency found in the known types passed in.

    kwargs

    Provide keyword arguments of known types.

    returns

    argTypes : list of numpy.dtype or None List of types of arguments. The order is in the same order as list_arguments() outTypes : list of numpy.dtype or None List of types of outputs. The order is in the same order as list_outputs() auxTypes : list of numpy.dtype or None List of types of outputs. The order is in the same order as list_auxiliary()

  73. def inferType(args: DType*): (Seq[DType], Seq[DType], Seq[DType])

    Permalink

    Infer the type of outputs and arguments of given known types of arguments.

    Infer the type of outputs and arguments of given known types of arguments. Tuple of Nones is returned if there is not enough information passed in. An error will be raised if there is inconsistency found in the known types passed in.

    args

    Provide type of arguments in a positional way. Unknown type can be marked as null

    returns

    argTypes : list of numpy.dtype or None List of types of arguments. The order is in the same order as list_arguments() outTypes : list of numpy.dtype or None List of types of outputs. The order is in the same order as list_outputs() auxTypes : list of numpy.dtype or None List of types of outputs. The order is in the same order as list_auxiliary()

  74. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  75. def listArguments(): IndexedSeq[String]

    Permalink

    List all the arguments in the symbol.

    List all the arguments in the symbol.

    returns

    Array of all the arguments.

  76. def listAttr(): Map[String, String]

    Permalink

    Gets all attributes from the symbol.

    Gets all attributes from the symbol.

    returns

    Map[String, String], mapping attribute keys to values.

  77. def listAuxiliaryStates(): IndexedSeq[String]

    Permalink

    List all auxiliary states in the symbol.

    List all auxiliary states in the symbol.

    returns

    The names of the auxiliary states.

    Note

    Auxiliary states are special states of symbols that do not corresponds to an argument, and do not have gradient. But still be useful for the specific operations. A common example of auxiliary state is the moving_mean and moving_variance in BatchNorm. Most operators do not have Auxiliary states.

  78. def listOutputs(): IndexedSeq[String]

    Permalink

    List all outputs in the symbol.

    List all outputs in the symbol.

    returns

    : List of all the outputs.

  79. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  80. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  81. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  82. def save(fname: String): Unit

    Permalink

    Save symbol into file.

    Save symbol into file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS)

    fname

    The name of the file

    • s3://my-bucket/path/my-s3-symbol
    • hdfs://my-bucket/path/my-hdfs-symbol
    • /path-to/my-local-symbol
    See also

    Symbol.load : Used to load symbol from file.

  83. def simpleBind(ctx: Context, gradReq: String = "write", shapeDict: Map[String, Shape], typeDict: Map[String, DType] = null): Executor

    Permalink

    Bind current symbol to get an executor, allocate all the ndarrays needed.

    Bind current symbol to get an executor, allocate all the ndarrays needed. Allows specifying data types. This function will ask user to pass in ndarray of position they like to bind to, and it will automatically allocate the ndarray for arguments and auxiliary states that user did not specify explicitly.

    ctx

    The device context the generated executor to run on.

    gradReq

    {'write', 'add', 'null'}, or list of str or dict of str to str, optional Specifies how we should update the gradient to the args_grad.

    • 'write' means everytime gradient is write to specified args_grad NDArray.
    • 'add' means everytime gradient is add to the specified NDArray.
    • 'null' means no action is taken, the gradient may not be calculated.
    shapeDict

    Input shape dictionary, name->shape

    typeDict

    Input type dictionary, name->dtype

    returns

    The generated Executor

  84. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  85. def toJson: String

    Permalink

    Save symbol into a JSON string.

    Save symbol into a JSON string. See Also symbol.loadJson : Used to load symbol from JSON string.

  86. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  87. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  89. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped