221 These may be fractional. 222 :param embedding_dim: the dimension of the output. :param max_period: controls the minimum frequency of the 223 embeddings. :return: an [N x dim] Tensor of positional embeddings. 224 """ 225 assert len(timesteps.shape) == 1, "Timesteps should be a 1d-array" 226 227 half_dim = embedding_dim // 2 228 exponent = -math.log(max_period) * torch.arange(