class_docstr: N-gram layer.
  
  The layer takes as input an integer Tensor of shape [..., length], each
  element of which is a token index in [0, input_dim). It returns a real-valued
  Tensor of shape [..., num_ngrams], counting the number of times each n-gram
  appears in a batch element. The total number of n-grams is
  
  ```none
  num_ngrams = \sum_{minval <= n < maxval} input_dim^n.
  ```
class_docstr_tok: ["N-gram","layer",".","The","layer","takes","as","input","an","integer","Tensor","of","shape","[","...",",","length","]",",","each","element","of","which","is","a","token","index","in","[","0",",","input_dim",")",".","It","returns","a","real-valued","Tensor","of","shape","[","...",",","num_ngrams","]",",","counting","the","number","of","times","each","n-gram","appears","in","a","batch","element",".","The","total","number","of","n-grams","is","``","`","none","num_ngrams","=","\\sum_","{","minval","<","=","n","<","maxval","}","input_dim^n",".","``","`"]
code: def get_config(self):
      config = {"minval": self.minval, "maxval": self.maxval}
      base_config = super(NGram, self).get_config()
      return dict(list(base_config.items()) + list(config.items()))
  
file_path: tensor2tensor/tensor2tensor/layers/ngram.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the NGram obj's underlying member method code with example usage: obj.get_config() and returns: dict