docstr: Construct a UniPC.
  
  We support both data_prediction and noise_prediction.
docstr_tok: ["Construct","a","UniPC",".","We","support","both","data_prediction","and","noise_prediction","."]
code: def __init__(
      self,
      model_fn,
      noise_schedule,
      predict_x0=True,
      thresholding=False,
      max_val=1.0,
      variant="bh1",
      condition=None,
      unconditional_condition=None,
      before_sample=None,
      after_sample=None,
      after_update=None,
  ):
      """Construct a UniPC.
  
      We support both data_prediction and noise_prediction.
      """
      self.model_fn_ = model_fn
      self.noise_schedule = noise_schedule
      self.variant = variant
      self.predict_x0 = predict_x0
      self.thresholding = thresholding
      self.max_val = max_val
      self.condition = condition
      self.unconditional_condition = unconditional_condition
      self.before_sample = before_sample
      self.after_sample = after_sample
      self.after_update = after_update
  
imports: import torch
  import math
  import tqdm
label_desc: Use image node_id 1 to create a new UniPC object  with example: obj = UniPC(model_fn, noise_schedule, predict_x0, thresholding, max_val, variant, condition, unconditional_condition, before_sample, after_sample, after_update)