code: def fully_connected(
      x,
      weight,
      bias=None,
      num_hidden=None,
      no_bias=True,
      flatten=True,
      **kwargs,
  ):
      r"""Applies a linear transformation: :math:`Y = XW^T + b`.
  
      If ``flatten`` is set to be true, then the shapes are:
  
      - **data**: `(batch_size, x1, x2, ..., xn)`
      - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
      - **bias**: `(num_hidden,)`
      - **out**: `(batch_size, num_hidden)`
  
      If ``flatten`` is set to be false, then the shapes are:
  
      - **data**: `(x1, x2, ..., xn, input_dim)`
      - **weight**: `(num_hidden, input_dim)`
      - **bias**: `(num_hidden,)`
      - **out**: `(x1, x2, ..., xn, num_hidden)`
  
      The learnable parameters include both ``weight`` and ``bias``.
  
      If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
  
      .. Note::
  
          The sparse support for FullyConnected is limited to forward evaluation with `row_sparse`
          weight and bias, where the length of `weight.indices` and `bias.indices` must be equal
          to `num_hidden`. This could be useful for model inference with `row_sparse` weights
          trained with importance sampling or noise contrastive estimation.
  
          To compute linear transformation with 'csr' sparse data, sparse.dot is recommended instead
          of sparse.FullyConnected.
  
      Parameters
      ----------
      data : NDArray
          Input data.
      weight : NDArray
          Weight matrix.
      bias : NDArray
          Bias parameter.
      num_hidden : int, required
          Number of hidden nodes of the output.
      no_bias : boolean, optional, default=0
          Whether to disable bias parameter.
      flatten : boolean, optional, default=1
          Whether to collapse all but the first axis of the input data tensor.
  
      Returns
      -------
      out : NDArray or list of NDArrays
          The output of this function.
      """
      assert (
          num_hidden is not None
      ), "Please provide number of hidden nodes"
      if no_bias:
          return _api_internal.fully_connected(
              x, weight, num_hidden, no_bias, flatten
          )
      else:
          assert bias is not None, "Missing bias parameter"
          return _api_internal.fully_connected(
              x, weight, bias, num_hidden, no_bias, flatten
          )
  
imports: import numpy
  from .._internal import NDArrayBase
  from .None import _api_internal
  from ...util import set_module
  from ..ndarray import get_dtype_name
label_desc: Use image node_id 7 for calling a global function with example usage: fully_connected(x, weight, bias, num_hidden, no_bias, flatten) and returns: _api_internal, _api_internal