   }
 
   public func sample<G: RandomNumberGenerator>(generator: inout G) -> ShapedArray<Scalar> {
-    // TODO: high = self.high if self.dtype.kind == 'f' else self.high.astype('int64') + 1
-    // TODO: return self.np_random.uniform(low=self.low, high=high, size=self.shape).astype(self.dtype)
-    fatalError("Not implemented.")
+    var scalars: [Scalar] = []
+    for (low, high) in zip(self.low.scalars, self.high.scalars) {
+      scalars.append(Scalar.random(in: low...high, using: &generator))
+    }
+    return ShapedArray(shape: shape, scalars: scalars)
   }
 
   public func contains(_ value: ShapedArray<Scalar>) -> Bool {

    for size in sizes {
      scalars.append(Int32.random(in: 0..<size, using: &generator))
    }
    return ShapedArray<Int32>(shape: shape, scalars: scalars)
  }

  public func contains(_ value: ShapedArray<Int32>) -> Bool {

  }
}

// TODO: How can we make this also support Scalar: BinaryFloatingPoint where 
// Scalar.RawSignificand: FixedWidthInteger?
public struct Box<Scalar: TensorFlowScalar & FixedWidthInteger & Codable>: Space {
  public let low: ShapedArray<Scalar>
  public let high: ShapedArray<Scalar>
  public let shape: [Int]
