Merge pull request #27863 from robertbrignull:java_init_logging
PiperOrigin-RevId: 257039697
This commit is contained in:
		
						commit
						413d93bc0a
					
				@ -63,7 +63,19 @@ public final class TensorFlow {
 | 
			
		||||
 | 
			
		||||
  /** Load the TensorFlow runtime C library. */
 | 
			
		||||
  static void init() {
 | 
			
		||||
    NativeLibrary.load();
 | 
			
		||||
    try {
 | 
			
		||||
      NativeLibrary.load();
 | 
			
		||||
    } catch (Exception e) {
 | 
			
		||||
      /*
 | 
			
		||||
       * This code is called during static initialization of this and of other classes.
 | 
			
		||||
       * If this fails then a NoClassDefFoundError is thrown however this does not
 | 
			
		||||
       * include a cause. Printing the exception manually here ensures that the
 | 
			
		||||
       * necessary information to fix the problem is available.
 | 
			
		||||
       */
 | 
			
		||||
      System.err.println("Failed to load TensorFlow native library");
 | 
			
		||||
      e.printStackTrace();
 | 
			
		||||
      throw e;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  static {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user