docstr: Download the tiny-random-xlnet model and make a concrete copy of it
  
  The issue here is that the "random" nature of the original
  makes it difficult or impossible to test that the values in
  the transformer don't change during certain operations.
  Saving a concrete instantiation of those random numbers makes
  it so we can test there is no difference when training only a
  subset of the layers, for example
docstr_tok: ["Download","the","tiny-random-xlnet","model","and","make","a","concrete","copy","of","it","The","issue","here","is","that","the","``","random","''","nature","of","the","original","makes","it","difficult","or","impossible","to","test","that","the","values","in","the","transformer","do","n't","change","during","certain","operations",".","Saving","a","concrete","instantiation","of","those","random","numbers","makes","it","so","we","can","test","there","is","no","difference","when","training","only","a","subset","of","the","layers",",","for","example"]
code: def tiny_random_xlnet(self, tmp_path_factory):
      """
      Download the tiny-random-xlnet model and make a concrete copy of it
  
      The issue here is that the "random" nature of the original
      makes it difficult or impossible to test that the values in
      the transformer don't change during certain operations.
      Saving a concrete instantiation of those random numbers makes
      it so we can test there is no difference when training only a
      subset of the layers, for example
      """
      xlnet_name = "hf-internal-testing/tiny-random-xlnet"
      xlnet_model, xlnet_tokenizer = load_bert(xlnet_name)
      path = str(tmp_path_factory.mktemp("tiny-random-xlnet"))
      xlnet_model.save_pretrained(path)
      xlnet_tokenizer.save_pretrained(path)
      return path
  
imports: from collections import defaultdict
  import logging
  import pathlib
  import tempfile
  import pytest
  import torch
  from torch import optim
  from stanza import Pipeline
  from stanza.models import constituency_parser
  from stanza.models.common import pretrain
  from stanza.models.common.bert_embedding import load_bert, load_tokenizer
  from stanza.models.common.foundation_cache import FoundationCache
  from stanza.models.common.utils import set_random_seed
  from stanza.models.constituency import lstm_model
  from stanza.models.constituency import trainer
  from stanza.models.constituency import tree_reader
  from stanza.tests import *
label_desc: Use image node_id 2 for calling the TestTrainer obj's underlying member method code with example usage: obj.tiny_random_xlnet(tmp_path_factory) and returns: path