code: def add_sample(self, sample):
      if len(sample) != self.sample_dim:
          raise ValueError(
              "Invalid sample dimension for input {0}".format(self.name)
          )
  
      byte_size = len(sample) * (4 if self.is_float() else 8)
  
      if len(self.sequences) == 0:
          self.sequences.append([])
          byte_size += 4
  
      self.sequences[-1].append([float(x) for x in sample])
  
      return byte_size
  
imports: import sys
  import argparse
  import struct
  import os
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling the DenseConverter obj's underlying member method code with example usage: obj.add_sample(sample) and returns: byte_size