class_docstr: Scale the input data so that it lies in between the lower and upper bounds.
  
  In training (`self.train()`), this module adjusts the scaling factor to the minibatch of data.
  During evaluation (`self.eval()`), this module uses the scaling factor from the previous minibatch of data.
  
  :param float lower_bound: lower bound of scaled data
  :param float upper_bound: upper bound of scaled data
  
  Example:
      >>> train_x = torch.randn(10, 5)
      >>> module = gpytorch.utils.grid.ScaleToBounds(lower_bound=-1., upper_bound=1.)
      >>>
      >>> module.train()
      >>> scaled_train_x = module(train_x)  # Data should be between -0.95 and 0.95
      >>>
      >>> module.eval()
      >>> test_x = torch.randn(10, 5)
      >>> scaled_test_x = module(test_x)  # Scaling is based on train_x
class_docstr_tok: ["Scale","the","input","data","so","that","it","lies","in","between","the","lower","and","upper","bounds",".","In","training","(","`","self.train","(",")","`",")",",","this","module","adjusts","the","scaling","factor","to","the","minibatch","of","data",".","During","evaluation","(","`","self.eval","(",")","`",")",",","this","module","uses","the","scaling","factor","from","the","previous","minibatch","of","data",".",":","param","float","lower_bound",":","lower","bound","of","scaled","data",":","param","float","upper_bound",":","upper","bound","of","scaled","data","Example",":",">",">",">","train_x","=","torch.randn","(","10",",","5",")",">",">",">","module","=","gpytorch.utils.grid.ScaleToBounds","(","lower_bound=-1.",",","upper_bound=1",".",")",">",">",">",">",">",">","module.train","(",")",">",">",">","scaled_train_x","=","module","(","train_x",")","#","Data","should","be","between","-0.95","and","0.95",">",">",">",">",">",">","module.eval","(",")",">",">",">","test_x","=","torch.randn","(","10",",","5",")",">",">",">","scaled_test_x","=","module","(","test_x",")","#","Scaling","is","based","on","train_x"]
code: def __init__(self, lower_bound, upper_bound):
      super().__init__()
      self.lower_bound = float(lower_bound)
      self.upper_bound = float(upper_bound)
      self.register_buffer("min_val", torch.tensor(lower_bound))
      self.register_buffer("max_val", torch.tensor(upper_bound))
  
file_path: gpytorch/gpytorch/utils/grid.py
imports: import math
  import warnings
  from typing import List, Tuple
  import torch
label_desc: Use image node_id 1 to create a new ScaleToBounds object from inherited base classes: torch.nn with example: obj = ScaleToBounds(lower_bound, upper_bound)