def multiply(s1: Tensor,
    s2: Tensor) -> Tensor:
  _0 = __torch__.pymomentum.skel_state._normalize_split_skel_state
  _1 = __torch__.pymomentum.skel_state._multiply_split_skel_states
  _2 = __torch__.pymomentum.skel_state.check(s1, )
  _3 = __torch__.pymomentum.skel_state.check(s2, )
  _4 = torch.lt(torch.dim(s1), torch.dim(s2))
  s10 = s1
  _5 = _4
  while _5:
    s11 = torch.unsqueeze(s10, 0)
    _6 = torch.lt(torch.dim(s11), torch.dim(s2))
    _5, s10 = _6, s11
  _7 = __torch__.pymomentum.skel_state.split(s10, )
  _8 = _0(_7, )
  _9 = __torch__.pymomentum.skel_state.split(s2, )
  return _1(_8, _0(_9, ), )
def transform_points(skel_state: Tensor,
    points: Tensor) -> Tensor:
  _10 = "Points tensor should have last dimension 3."
  _11 = __torch__.pymomentum.skel_state._normalize_split_skel_state
  _12 = __torch__.pymomentum.skel_state._transform_points_split_skel_state
  _13 = __torch__.pymomentum.skel_state.check(skel_state, )
  if torch.lt(torch.dim(points), 1):
    _14 = True
  else:
    _15 = torch.ne((torch.size(points))[-1], 3)
    _14 = _15
  if _14:
    ops.prim.RaiseException(_10, "builtins.ValueError")
  else:
    pass
  _16 = torch.lt(torch.dim(skel_state), torch.dim(points))
  skel_state0 = skel_state
  _17 = _16
  while _17:
    skel_state1 = torch.unsqueeze(skel_state0, 0)
    _18 = torch.lt(torch.dim(skel_state1), torch.dim(points))
    _17, skel_state0 = _18, skel_state1
  _19 = __torch__.pymomentum.skel_state.split(skel_state0, )
  return _12(_11(_19, ), points, )
def check(skel_state: Tensor) -> NoneType:
  _20 = "Expected skeleton state to have last dimension 8 (tx, ty, tz, rx, ry, rz, rw, s)"
  _21 = torch.ne((torch.size(skel_state))[-1], 8)
  if _21:
    ops.prim.RaiseException(_20, "builtins.ValueError")
  else:
    pass
  return None
def split(skel_state: Tensor) -> Tuple[Tensor, Tensor, Tensor]:
  _22 = __torch__.pymomentum.skel_state.check(skel_state, )
  _23 = (torch.slice(skel_state, -1, None, 3), torch.slice(skel_state, -1, 3, 7), torch.slice(skel_state, -1, 7))
  return _23
def _normalize_split_skel_state(components: Tuple[Tensor, Tensor, Tensor]) -> Tuple[Tensor, Tensor, Tensor]:
  _24 = __torch__.pymomentum.quaternion.normalize
  t, q, s, = components
  return (t, _24(q, ), s)
def _multiply_split_skel_states(skel_state1: Tuple[Tensor, Tensor, Tensor],
    skel_state2: Tuple[Tensor, Tensor, Tensor]) -> Tensor:
  _25 = __torch__.pymomentum.quaternion.rotate_vector_assume_normalized
  _26 = __torch__.pymomentum.quaternion.multiply_assume_normalized
  t1, q1, s1, = skel_state1
  t2, q2, s2, = skel_state2
  t_res = torch.add(t1, torch.mul(s1, _25(q1, t2, )))
  s_res = torch.mul(s1, s2)
  q_res = _26(q1, q2, )
  return torch.cat([t_res, q_res, s_res], -1)
def _transform_points_split_skel_state(skel_state: Tuple[Tensor, Tensor, Tensor],
    points: Tensor) -> Tensor:
  _27 = __torch__.pymomentum.quaternion.rotate_vector
  t, q, s, = skel_state
  _28 = torch.add(t, _27(q, torch.mul(s, points), ))
  return _28
