 
   public func gathering(atIndices indices: Tensor<Int64>) -> Self {
     var result = self
+    for kp in result.recursivelyAllWritableKeyPaths(to: Tensor<UInt8>.self) {
+      result[keyPath: kp] = result[keyPath: kp].gathering(atIndices: indices)
+    }
     for kp in result.recursivelyAllWritableKeyPaths(to: Tensor<Int32>.self) {
       result[keyPath: kp] = result[keyPath: kp].gathering(atIndices: indices)
     }

extension KeyPathIterable {
  public static func stack(_ values: [Self]) -> Self {
    var result = values[0]
    for kp in result.recursivelyAllWritableKeyPaths(to: Tensor<Int32>.self) {
      result[keyPath: kp] = Tensor.stack(values.map { $0[keyPath: kp] })
    }

  }

  public mutating func update(atIndices indices: Tensor<Int64>, using values: Self) {
    for kp in recursivelyAllWritableKeyPaths(to: Tensor<UInt8>.self) {
      self[keyPath: kp].update(atIndices: indices, using: values[keyPath: kp])
    }
    for kp in recursivelyAllWritableKeyPaths(to: Tensor<Int32>.self) {
      self[keyPath: kp].update(atIndices: indices, using: values[keyPath: kp])
    }
