def type
      return @data.nm_dtype if dtype == :nmatrix

      if @type.nil? || @possibly_changed_type
        @type = :numeric
        each do |e|
          next if e.nil? || e.is_a?(Numeric)
          @type = :object
          break
        end
        @possibly_changed_type = false
      end

      @type
    end
The type of data contained in the vector. Can be :object or :numeric. If
the underlying dtype is an NMatrix, this method will return the data type
of the NMatrix object.

Running through the data to figure out the kind of data is delayed to the
last possible moment.