[Model Runner V2][Minor] Simplify PP logic (#38031)
Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
@@ -62,3 +62,12 @@ class IntermediateTensors:
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"IntermediateTensors(tensors={self.tensors})"
|
||||
|
||||
@staticmethod
|
||||
def empty_like(
|
||||
intermediate_tensors: "IntermediateTensors",
|
||||
) -> "IntermediateTensors":
|
||||
tensors = {
|
||||
k: torch.empty_like(v) for k, v in intermediate_tensors.tensors.items()
|
||||
}
|
||||
return IntermediateTensors(tensors)
|
||||
|
||||
Reference in New Issue
Block a user