code: public int getDeviceCountOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.Integer> map =
          internalGetDeviceCount().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }
docs: <pre>
  Map from device type name (e.g., "CPU" or "GPU" ) to maximum
  number of devices of that type to use.  If a particular device
  type is not found in the map, the system picks an appropriate
  number.
  </pre>
  
  <code>map&lt;string, int32&gt; device_count = 1;</code>