class_docstr: Assemble features into an MXNet tensor. Input features are distinguished
  based on the following criteria:
  
  - static (time-independent) features vs dynamic (that is, time-dependent)
  - categorical vs real-valued features.
  
  Dynamic features have shape `(N, T, C)` and static features have shape
  `(N, C)`, where
  
      - `N` is the number of elements in the processed batch,
      - `T` is the time dimension,
      - `C` is the number of features.
  
  If multiple feature types are used, the :class:`FeatureAssembler` will
  assume that the N and T dimensions are the same for all passed arguments.
  
  Categorical features can be optionally embedded using trained embedding
  layers via nested :class:`FeatureEmbedder` components.
  
  >>> embed_static = FeatureEmbedder(
  ...     cardinalities=[2],
  ...     embedding_dims=[3],
  ...     prefix='embed_static_',
  ... )
  >>> embed_dynamic = FeatureEmbedder(
  ...     cardinalities=[5, 5],
  ...     embedding_dims=[6, 9],
  ...     prefix='embed_dynamic_',
  ... )
  
  The above snippet with four :class:`nn.Embedding` corresponding to the one
  static and two dynamic categorical features. The `(input_dim, output_dim)`
  of these layers are going to be `(2, 3)`, `(5, 6)`, and `(5, 9)`. The
  created `assemble_feature` instance will not handle real-valued features.
  
  The subset of feature types to be used by the :class:`FeatureAssembler`
  instance is determined using corresponding constructor parameters. Here is
  an example that constructs a feature assembler consuming only real-valued
  features.
  
  >>> N, T = 50, 168
  >>> assemble_feature = FeatureAssembler(
  ...     T=T,
  ...     # use_static_cat=True,
  ...     # use_static_real=False,
  ...     # use_dynamic_cat=True,
  ...     # use_dynamic_real=False,
  ...     embed_static=embed_static,
  ...     embed_dynamic=embed_dynamic
  ... )
  
  When the `__call__`, `forward`, or `hybrid_forward` methods of
  a :class:`FeatureAssembler` are called, we always have to pass a full set
  of features. Missing features are represented as zero tensors with a
  suitable shape.
  
  For example,
  
  >>> import mxnet as mx
  >>> feat_static_cat = mx.nd.random.uniform(0, 2, shape=(N, 1)).floor()
  >>> feat_dynamic_cat = mx.nd.random.uniform(
      0, 5, shape=(N, 168, 2)
  ).floor()
  >>> feat_static_real = mx.nd.zeros(shape=(N, 1,)) # empty feature
  >>> feat_dynamic_real = mx.nd.zeros(shape=(N, T, 1,)) # empty feature
  
  After initializing the embedder parameters to one and instantiating some
  random `static_cat` and `dynamic_cat` vectors,
  
  >>> assemble_feature.collect_params().initialize(mx.initializer.One())
  
  one can do a forward pass as follows.
  
  >>> assembled_feature = assemble_feature(
      feat_static_cat, feat_static_real, feat_dynamic_cat, feat_dynamic_real
  )
  >>> assembled_feature.shape
  (50, 168, 20)
  >>>
  
  However, relative order of `static_cat` and `dynamic_cat` in the call above
  is determined by the fact that `use_static_cat` is defined before
  `use_dynamic_cat` in the class constructor.
class_docstr_tok: ["Assemble","features","into","an","MXNet","tensor",".","Input","features","are","distinguished","based","on","the","following","criteria",":","-","static","(","time-independent",")","features","vs","dynamic","(","that","is",",","time-dependent",")","-","categorical","vs","real-valued","features",".","Dynamic","features","have","shape","`","(","N",",","T",",","C",")","`","and","static","features","have","shape","`","(","N",",","C",")","`",",","where","-","`","N","`","is","the","number","of","elements","in","the","processed","batch",",","-","`","T","`","is","the","time","dimension",",","-","`","C","`","is","the","number","of","features",".","If","multiple","feature","types","are","used",",","the",":","class",":","`","FeatureAssembler","`","will","assume","that","the","N","and","T","dimensions","are","the","same","for","all","passed","arguments",".","Categorical","features","can","be","optionally","embedded","using","trained","embedding","layers","via","nested",":","class",":","`","FeatureEmbedder","`","components",".",">",">",">","embed_static","=","FeatureEmbedder","(","...","cardinalities=","[","2","]",",","...","embedding_dims=","[","3","]",",","...","prefix='embed_static_","'",",","...",")",">",">",">","embed_dynamic","=","FeatureEmbedder","(","...","cardinalities=","[","5",",","5","]",",","...","embedding_dims=","[","6",",","9","]",",","...","prefix='embed_dynamic_","'",",","...",")","The","above","snippet","with","four",":","class",":","`","nn.Embedding","`","corresponding","to","the","one","static","and","two","dynamic","categorical","features",".","The","`","(","input_dim",",","output_dim",")","`","of","these","layers","are","going","to","be","`","(","2",",","3",")","`",",","`","(","5",",","6",")","`",",","and","`","(","5",",","9",")","`",".","The","created","`","assemble_feature","`","instance","will","not","handle","real-valued","features",".","The","subset","of","feature","types","to","be","used","by","the",":","class",":","`","FeatureAssembler","`","instance","is","determined","using","corresponding","constructor","parameters",".","Here","is","an","example","that","constructs","a","feature","assembler","consuming","only","real-valued","features",".",">",">",">","N",",","T","=","50",",","168",">",">",">","assemble_feature","=","FeatureAssembler","(","...","T=T",",","...","#","use_static_cat=True",",","...","#","use_static_real=False",",","...","#","use_dynamic_cat=True",",","...","#","use_dynamic_real=False",",","...","embed_static=embed_static",",","...","embed_dynamic=embed_dynamic","...",")","When","the","`","__call__","`",",","`","forward","`",",","or","`","hybrid_forward","`","methods","of","a",":","class",":","`","FeatureAssembler","`","are","called",",","we","always","have","to","pass","a","full","set","of","features",".","Missing","features","are","represented","as","zero","tensors","with","a","suitable","shape",".","For","example",",",">",">",">","import","mxnet","as","mx",">",">",">","feat_static_cat","=","mx.nd.random.uniform","(","0",",","2",",","shape=","(","N",",","1",")",")",".floor","(",")",">",">",">","feat_dynamic_cat","=","mx.nd.random.uniform","(","0",",","5",",","shape=","(","N",",","168",",","2",")",")",".floor","(",")",">",">",">","feat_static_real","=","mx.nd.zeros","(","shape=","(","N",",","1",",",")",")","#","empty","feature",">",">",">","feat_dynamic_real","=","mx.nd.zeros","(","shape=","(","N",",","T",",","1",",",")",")","#","empty","feature","After","initializing","the","embedder","parameters","to","one","and","instantiating","some","random","`","static_cat","`","and","`","dynamic_cat","`","vectors",",",">",">",">","assemble_feature.collect_params","(",")",".initialize","(","mx.initializer.One","(",")",")","one","can","do","a","forward","pass","as","follows",".",">",">",">","assembled_feature","=","assemble_feature","(","feat_static_cat",",","feat_static_real",",","feat_dynamic_cat",",","feat_dynamic_real",")",">",">",">","assembled_feature.shape","(","50",",","168",",","20",")",">",">",">","However",",","relative","order","of","`","static_cat","`","and","`","dynamic_cat","`","in","the","call","above","is","determined","by","the","fact","that","`","use_static_cat","`","is","defined","before","`","use_dynamic_cat","`","in","the","class","constructor","."]
code: def process_dynamic_real(self, F, feature: Tensor) -> Tensor:
      return feature
  
file_path: gluonts/src/gluonts/mx/block/feature.py
imports: from typing import Callable, List, Optional, Type
  import mxnet.gluon.nn
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
label_desc: Use image node_id 6 for calling the FeatureAssembler obj's underlying member method code with example usage: obj.process_dynamic_real(F, feature) and returns: feature