code: def _offset_for(self, param):
          
          if param.has_parent():
              p = param._parent_._get_original(param)
              if p in self.parameters:
                  return reduce(lambda a,b: a + b.size, self.parameters[:p._parent_index_], 0)
              return self._offset_for(param._parent_) + param._parent_._offset_for(param)
          return 0
docs: Return the offset of the param inside this parameterized object.
          This does not need to account for shaped parameters, as it
          basically just sums up the parameter sizes which come before param.