class_docstr: `SpanExtractorWithSpanWidthEmbedding` implements some common code for span
  extractors which will need to embed span width.
  
  Specifically, we initiate the span width embedding matrix and other
  attributes in `__init__`, leave an `_embed_spans` method that can be
  implemented to compute span embeddings in different ways, and in `forward`
  we concatenate span embeddings returned by `_embed_spans` with span width
  embeddings to form the final span representations.
  
  We keep SpanExtractor as a purely abstract base class, just in case someone
  wants to build a totally different span extractor.
  
  # Parameters
  
  input_dim : `int`, required.
      The final dimension of the `sequence_tensor`.
  num_width_embeddings : `int`, optional (default = `None`).
      Specifies the number of buckets to use when representing
      span width features.
  span_width_embedding_dim : `int`, optional (default = `None`).
      The embedding size for the span_width features.
  bucket_widths : `bool`, optional (default = `False`).
      Whether to bucket the span widths into log-space buckets. If `False`,
      the raw span widths are used.
  
  # Returns
  
  span_embeddings : `torch.FloatTensor`.
      A tensor of shape `(batch_size, num_spans, embedded_span_size)`,
      where `embedded_span_size` depends on the way spans are represented.
class_docstr_tok: ["`","SpanExtractorWithSpanWidthEmbedding","`","implements","some","common","code","for","span","extractors","which","will","need","to","embed","span","width",".","Specifically",",","we","initiate","the","span","width","embedding","matrix","and","other","attributes","in","`","__init__","`",",","leave","an","`","_embed_spans","`","method","that","can","be","implemented","to","compute","span","embeddings","in","different","ways",",","and","in","`","forward","`","we","concatenate","span","embeddings","returned","by","`","_embed_spans","`","with","span","width","embeddings","to","form","the","final","span","representations",".","We","keep","SpanExtractor","as","a","purely","abstract","base","class",",","just","in","case","someone","wants","to","build","a","totally","different","span","extractor",".","#","Parameters","input_dim",":","`","int","`",",","required",".","The","final","dimension","of","the","`","sequence_tensor","`",".","num_width_embeddings",":","`","int","`",",","optional","(","default","=","`","None","`",")",".","Specifies","the","number","of","buckets","to","use","when","representing","span","width","features",".","span_width_embedding_dim",":","`","int","`",",","optional","(","default","=","`","None","`",")",".","The","embedding","size","for","the","span_width","features",".","bucket_widths",":","`","bool","`",",","optional","(","default","=","`","False","`",")",".","Whether","to","bucket","the","span","widths","into","log-space","buckets",".","If","`","False","`",",","the","raw","span","widths","are","used",".","#","Returns","span_embeddings",":","`","torch.FloatTensor","`",".","A","tensor","of","shape","`","(","batch_size",",","num_spans",",","embedded_span_size",")","`",",","where","`","embedded_span_size","`","depends","on","the","way","spans","are","represented","."]
code: def get_input_dim(self) -> int:
      return self._input_dim
  
file_path: allennlp/allennlp/modules/span_extractors/span_extractor_with_span_width_embedding.py
imports: from typing import Optional
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.modules.span_extractors.span_extractor import SpanExtractor
  from allennlp.modules.token_embedders.embedding import Embedding
  from allennlp.nn import util
label_desc: Use image node_id 3 for calling the SpanExtractorWithSpanWidthEmbedding obj's underlying member method code with example usage: obj.get_input_dim() and returns: self