code: public void setValueFor(Field target, Object value) {
          if(value == null && target.getType().isPrimitive()) {
              throw new ND4JIllegalStateException("Unable to set primitive field " + target + " of type " + target.getClass()
                      + " using null value!");
          }
  
          if(value != null) {
              value = ensureProperType(target, value);
          }
  
          if(isConfigProperties()){
              String propertyName = configFieldName();
              if(propertyName == null)
                  propertyName = "config";
              Field f = null;
              Class<?> currClass = getClass();
              try{
                  f = currClass.getDeclaredField(propertyName);
              } catch (NoSuchFieldException e){
                  //OK, try superclass
              }
              while(f == null && currClass.getSuperclass() != null){
                  currClass = currClass.getSuperclass();
                  try{
                      f = currClass.getDeclaredField(propertyName);
                  } catch (NoSuchFieldException e){
                      //OK, try superclass
                  }
              }
  
              if(f == null){
                  throw new IllegalStateException("Could not find field \"" + propertyName + "\" for class " + getClass().getName());
              }
  
              try {
                  f.setAccessible(true);
                  Object o = f.get(this);
                  if(o == null){
                      //Null config class - try to create one...
                      Class<?> c = f.getType();
                      try {
                          o = c.newInstance();
                      } catch (InstantiationException e){
                          throw new RuntimeException("Error creating new instance of configuration object type " + c.getName(), e);
                      }
                      f.set(this, o);
                  }
                  target.set(o, value);
              } catch (IllegalAccessException e){
                  throw new RuntimeException("Error setting configuration field \"" + propertyName + "\" for config field \"" + propertyName
                      + "\" on class " + getClass().getName());
              }
  
          } else {
              try {
                  target.set(this,value);
              } catch (IllegalAccessException e) {
                  throw new RuntimeException("Error setting property for function " + getClass().getName(), e);
              }
          }
      }
docs: Set the value for this function.
  Note that if value is null an {@link ND4JIllegalStateException}
  will be thrown.
  @param target the target field
  @param value the value to set