Implement construct_inputs class method for Ax integration #3037
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary:
LatentKroneckerGP requires
train_X,train_T, andtrain_Yas input data, wheretrain_Xandtrain_Tdefine the Cartesian product space andtrain_Yare the corresponding observations (with potentially missing values).Ax provides the data as samples from the product space and we need to separate it into the individual factors.
For example, let X = [a, b, c] and T = [0, 1], then the full product space is {(a, 0), (a, 1), (b, 0), (b, 1), (c, 0), (c, 1)}. Ax would provide us with observations like
x1 = (a, 0), y1 = 1
x2 = (a, 1), y2 = 2
x3 = (b, 0), y3 = 3
x4 = (c, 1), y4 = 4
and we need to transform them into X = [a, b, c], T = [0, 1], and Y = [[1, 2], [3, nan], [nan, 4]] (note that y values for (b, 1) and (c, 0) are missing).
Differential Revision: D83781022