public void resolvePropertiesFromSameDiffBeforeExecution ( ) { val properties = sameDiff . propertiesToResolveForFunction ( this ) ; val fields = DifferentialFunctionClassHolder . getInstance ( ) . getFieldsForFunction ( this ) ; val currentFields = this . propertiesForFunction ( ) ; for ( val property : properties ) { //property maybe a variable which is only an array //just skip if this is the case if ( ! fields . containsKey ( property ) ) continue ; val var = sameDiff . getVarNameForFieldAndFunction ( this , property ) ; val fieldType = fields . get ( property ) ; val varArr = sameDiff . getArrForVarName ( var ) ; //already defined if ( currentFields . containsKey ( property ) ) { continue ; } /** * Possible cause: * Might be related to output name alignment. * */ if ( varArr == null ) { throw new ND4JIllegalStateException ( "Unable to set null array!" ) ; } if ( fieldType . getType ( ) . equals ( int [ ] . class ) ) { setValueFor ( fieldType , varArr . data ( ) . asInt ( ) ) ; } else if ( fieldType . equals ( double [ ] . class ) ) { setValueFor ( fieldType , varArr . data ( ) . asDouble ( ) ) ; } else if ( fieldType . equals ( int . class ) ) { setValueFor ( fieldType , varArr . getInt ( 0 ) ) ; } else if ( fieldType . equals ( double . class ) ) { setValueFor ( fieldType , varArr . getDouble ( 0 ) ) ; } } }
Resolve properties and arguments right before execution of this operation .