pub fn new<'p, P>(p: P, config: &AlbertConfig) -> AlbertForMaskedLM
    where
        P: Borrow<nn::Path<'p>>,
    {
        let p = p.borrow();

        let albert = AlbertModel::new(p / "albert", config);
        let predictions = AlbertMLMHead::new(p / "predictions", config);

        AlbertForMaskedLM {
            albert,
            predictions,
        }
    }
/// Build a new `AlbertForMaskedLM`
///
/// # Arguments
///
/// * `p` - Variable store path for the root of the ALBERT model
/// * `config` - `AlbertConfig` object defining the model architecture and decoder status
///
/// # Example
///
/// ```no_run
/// use rust_bert::albert::{AlbertConfig, AlbertForMaskedLM};
/// use rust_bert::Config;
/// use std::path::Path;
/// use tch::{nn, Device};
///
/// let config_path = Path::new("path/to/config.json");
/// let device = Device::Cpu;
/// let p = nn::VarStore::new(device);
/// let config = AlbertConfig::from_file(config_path);
/// let albert: AlbertForMaskedLM = AlbertForMaskedLM::new(&p.root(), &config);
/// ```
Build a new `AlbertForMaskedLM`
Build a new ` AlbertForMaskedLM `
pub fn new<'p, P>(p: P, config: &AlbertConfig) -> AlbertForMaskedLM
    where
        P: Borrow<nn::Path<'p>>,
    {
        let p = p.borrow();
        let albert = AlbertModel::new(p / "albert", config);
        let predictions = AlbertMLMHead::new(p / "predictions", config);
        AlbertForMaskedLM {
            albert,
            predictions,
        }
    }
pub fn new < ' p , P > ( p : P , config : & AlbertConfig ) -> AlbertForMaskedLM where P : Borrow < nn :: Path < ' p > > , { let p = p . borrow ( ) ; let albert = AlbertModel :: new ( p / " " , config ) ; let predictions = AlbertMLMHead :: new ( p / " " , config ) ; AlbertForMaskedLM { albert , predictions , } }
Build a new `AlbertForMaskedLM`
Build a new ` AlbertForMaskedLM `
p
P
config
&AlbertConfig
p
P
config
&AlbertConfig
example
```no_run
use rust_bert::albert::{AlbertConfig, AlbertForMaskedLM};
use rust_bert::Config;
use std::path::Path;
use tch::{nn, Device}.

let config_path = Path::new("path/to/config.json");
let device = Device::Cpu;
let p = nn::VarStore::new(device);
let config = AlbertConfig::from_file(config_path);
let albert: AlbertForMaskedLM = AlbertForMaskedLM::new(&p.root(), &config);
```
` ` ` no_run use rust_bert :: albert :: { AlbertConfig AlbertForMaskedLM } ; use rust_bert :: Config ; use std :: path :: Path ; use tch :: { nn Device } . let config_path = Path :: new ( " path / to / config . json " ) ; let device = Device :: Cpu ; let p = nn :: VarStore :: new ( device ) ; let config = AlbertConfig :: from_file ( config_path ) ; let albert : AlbertForMaskedLM = AlbertForMaskedLM :: new ( &p . root () &config ) ; ` ` `