(path)
return Initializer
Loads parameters from .npy file.
Loads parameters from .npy file.
Loads parameters from . npy file .
def InitializerFromFile(path):
  """Loads parameters from .npy file."""

  def Initializer(shape, rng):
    del rng
    logging.info('Loading pretrained embeddings from %s', path)
    with tf.io.gfile.GFile(path, 'rb') as f:
      parameters = jnp.load(f)
    assert jnp.shape(parameters) == shape, (
        'Expected shape %s, got %s' % (shape, jnp.shape(parameters)))
    return parameters

  return Initializer
def InitializerFromFile ( path ) : def Initializer ( shape , rng ) : del rng logging . info ( 'Loading pretrained embeddings from %s' , path ) with tf . io . gfile . GFile ( path , 'rb' ) as f : parameters = jnp . load ( f ) assert jnp . shape ( parameters ) == shape , ( 'Expected shape %s, got %s' % ( shape , jnp . shape ( parameters ) ) ) return parameters return Initializer