MCPcopy Create free account
hub / github.com/openai/point-e / scale_channels

Method scale_channels

point_e/diffusion/gaussian_diffusion.py:922–931  ·  view source on GitHub ↗
(self, x: th.Tensor)

Source from the content-addressed store, hash-verified

920 }
921
922 def scale_channels(self, x: th.Tensor) -> th.Tensor:
923 if self.channel_scales is not None:
924 x = x * th.from_numpy(self.channel_scales).to(x).reshape(
925 [1, -1, *([1] * (len(x.shape) - 2))]
926 )
927 if self.channel_biases is not None:
928 x = x + th.from_numpy(self.channel_biases).to(x).reshape(
929 [1, -1, *([1] * (len(x.shape) - 2))]
930 )
931 return x
932
933 def unscale_channels(self, x: th.Tensor) -> th.Tensor:
934 if self.channel_biases is not None:

Callers 1

training_lossesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected