class_docstr: N-ary TreeLSTM unit.
  
  .. warning::
  
      This feature is experimental. The interface can change in the future.
  
  This is a N-ary TreeLSTM unit as a chain.
  This link is a fixed-length arguments function, which compounds
  the states of all children nodes into the new states of
  a current (parent) node. *states* denotes the cell state, :math:`c`,
  and the output, :math:`h`, which are produced by this link.
  This link doesn't keep cell and hidden states internally.
  
  For example, this link is called such as
  ``func(c1, c2, h1, h2, x)`` if the number of children nodes
  was set 2 (``n_ary = 2``), while
  ``func(c1, c2, c3, h1, h2, h3, x)`` if that was 3
  (``n_ary = 3``).
  This function is *dependent* from an order of children nodes
  unlike Child-Sum TreeLSTM.
  Thus, the returns of ``func(c1, c2, h1, h2, x)`` are
  different from those of ``func(c2, c1, h2, h1, x)``.
  
  Args:
      in_size (int): Dimension of input vectors.
      out_size (int): Dimensionality of cell and output vectors.
      n_ary (int): The number of children nodes in a tree structure.
  
  Attributes:
      W_x (chainer.links.Linear): Linear layer of
          connections from input vectors.
      W_h (chainer.links.Linear): Linear layer of connections between
          (:math:`a`, :math:`i`, :math:`o`, all :math:`f`)
          and the output of each child.
          :math:`a`, :math:`i`, :math:`o` and :math:`f` denotes input
          compound, input gate, output gate and forget gate, respectively.
          :math:`a`, input compound, equals to :math:`u` in
          the paper by Tai et al.
  
  See the papers for details: `Improved Semantic Representations From
  Tree-Structured Long Short-Term Memory Networks
  <https://www.aclweb.org/anthology/P15-1150>`_, and
  `A Fast Unified Model for Parsing and Sentence Understanding
  <https://arxiv.org/pdf/1603.06021.pdf>`_.
  
  Tai et al.'s N-Ary TreeLSTM is little extended in
  Bowman et al., and this link is based on
  the variant by Bowman et al.
  Specifically, eq. 10 in Tai et al. has only one :math:`W` matrix
  to be applied to :math:`x`, consistently for all children.
  On the other hand, Bowman et al.'s model has multiple matrices,
  each of which affects the forget gate for each child's cell individually.
class_docstr_tok: ["N-ary","TreeLSTM","unit",".","..","warning",":",":","This","feature","is","experimental",".","The","interface","can","change","in","the","future",".","This","is","a","N-ary","TreeLSTM","unit","as","a","chain",".","This","link","is","a","fixed-length","arguments","function",",","which","compounds","the","states","of","all","children","nodes","into","the","new","states","of","a","current","(","parent",")","node",".","*","states","*","denotes","the","cell","state",",",":","math",":","`","c","`",",","and","the","output",",",":","math",":","`","h","`",",","which","are","produced","by","this","link",".","This","link","does","n't","keep","cell","and","hidden","states","internally",".","For","example",",","this","link","is","called","such","as","``","func","(","c1",",","c2",",","h1",",","h2",",","x",")","``","if","the","number","of","children","nodes","was","set","2","(","``","n_ary","=","2","``",")",",","while","``","func","(","c1",",","c2",",","c3",",","h1",",","h2",",","h3",",","x",")","``","if","that","was","3","(","``","n_ary","=","3","``",")",".","This","function","is","*","dependent","*","from","an","order","of","children","nodes","unlike","Child-Sum","TreeLSTM",".","Thus",",","the","returns","of","``","func","(","c1",",","c2",",","h1",",","h2",",","x",")","``","are","different","from","those","of","``","func","(","c2",",","c1",",","h2",",","h1",",","x",")","``",".","Args",":","in_size","(","int",")",":","Dimension","of","input","vectors",".","out_size","(","int",")",":","Dimensionality","of","cell","and","output","vectors",".","n_ary","(","int",")",":","The","number","of","children","nodes","in","a","tree","structure",".","Attributes",":","W_x","(","chainer.links.Linear",")",":","Linear","layer","of","connections","from","input","vectors",".","W_h","(","chainer.links.Linear",")",":","Linear","layer","of","connections","between","(",":","math",":","`","a","`",",",":","math",":","`","i","`",",",":","math",":","`","o","`",",","all",":","math",":","`","f","`",")","and","the","output","of","each","child",".",":","math",":","`","a","`",",",":","math",":","`","i","`",",",":","math",":","`","o","`","and",":","math",":","`","f","`","denotes","input","compound",",","input","gate",",","output","gate","and","forget","gate",",","respectively",".",":","math",":","`","a","`",",","input","compound",",","equals","to",":","math",":","`","u","`","in","the","paper","by","Tai","et","al",".","See","the","papers","for","details",":","`","Improved","Semantic","Representations","From","Tree-Structured","Long","Short-Term","Memory","Networks","<","https",":","\/\/www.aclweb.org\/anthology\/P15-1150",">","`","_",",","and","`","A","Fast","Unified","Model","for","Parsing","and","Sentence","Understanding","<","https",":","\/\/arxiv.org\/pdf\/1603.06021.pdf",">","`","_",".","Tai","et","al",".","'s","N-Ary","TreeLSTM","is","little","extended","in","Bowman","et","al.",",","and","this","link","is","based","on","the","variant","by","Bowman","et","al",".","Specifically",",","eq",".","10","in","Tai","et","al",".","has","only","one",":","math",":","`","W","`","matrix","to","be","applied","to",":","math",":","`","x","`",",","consistently","for","all","children",".","On","the","other","hand",",","Bowman","et","al",".","'s","model","has","multiple","matrices",",","each","of","which","affects","the","forget","gate","for","each","child","'s","cell","individually","."]
code: def _pad_zero_nodes(self, vs, shape, dtype=numpy.float32):
      if any(v is None for v in vs):
          zero = self.xp.zeros(shape, dtype=dtype)
          return tuple(zero if v is None else v for v in vs)
      else:
          return vs
  
file_path: chainer/chainer/links/rnn/tree_lstm.py
imports: import numpy
  from chainer.functions.activation import sigmoid
  from chainer.functions.activation import tanh
  from chainer.functions.array import concat
  from chainer.functions.array import split_axis
  from chainer.functions.rnn import tree_lstm
  from chainer import link
  from chainer.links.connection import linear
label_desc: Use image node_id 3 for calling the NaryTreeLSTM obj's underlying member method code with example usage: obj._pad_zero_nodes(vs, shape, dtype) and returns: tuple, vs