code: def sinusoids(length, channels, max_timescale=10000):
      """Returns sinusoids for positional embedding"""
      assert channels % 2 == 0
      log_timescale_increment = np.log(max_timescale) / (
          channels // 2 - 1
      )
      inv_timescales = torch.exp(
          -log_timescale_increment * torch.arange(channels // 2)
      )
      scaled_time = (
          torch.arange(length)[:, np.newaxis]
          * inv_timescales[np.newaxis, :]
      )
      return torch.cat(
          [torch.sin(scaled_time), torch.cos(scaled_time)], dim=1
      )
  
imports: import base64
  import gzip
  from dataclasses import dataclass
  from typing import Dict, Iterable, Optional
  import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from .decoding import decode
  from .decoding import detect_language
  from .transcribe import transcribe
label_desc: Use image node_id 1 for calling a global function with example usage: sinusoids(length, channels, max_timescale) and returns: torch