     public private(set) var itemCountPerElement: Int
 
     /// Contiguous storage
-    public var items: ArraySlice<ItemType>
+    fileprivate var _items: ArraySlice<ItemType>
 
     /// Capacity reserved for sub-tensors
     public var capacity: Int {
-        return items.capacity / itemCountPerElement
+        return _items.capacity / itemCountPerElement
     }
 
     fileprivate init(elementShape: TensorShape?, items: ArraySlice<ItemType>) {


}

// MARK: - RangeReplaceableCollection
extension Tensor : RangeReplaceableCollection {

    public var itemCount: Int {
        return items.count
    }

    public mutating func append(_ newElement: Tensor<ItemType>) {
        precondition(newElement.shape == elementShape, "Element shape mismatch")
        reserveCapacity(count + 1)
        items.append(contentsOf: newElement.items)
    }

    public mutating func reserveCapacity(_ minimumCapacity: Int) {
        let cap = Swift.max(items.capacity, itemCountPerElement * minimumCapacity)
        items.reserveCapacity(cap)
    }

    @discardableResult
    public mutating func remove(at index: Int) -> Tensor<ItemType> {
        precondition(indices.contains(index), "Index out of range")
        let range: Range = itemSubrange(fromSubrange: index..<index+1)
        defer { items.removeSubrange(range) }
        return self[range]
    }



    func withUnsafeBufferPointer<Result>
        (_ body: (UnsafeBufferPointer<ItemType>) throws -> Result) rethrows -> Result {
        return try _items.withUnsafeBufferPointer { ptr in
            try body(ptr)
        }
    }

    mutating func withUnsafeMutableBufferPointer<Result>
        (_ body: (inout UnsafeMutableBufferPointer<ItemType>) throws -> Result) rethrows -> Result {
        return try _items.withUnsafeMutableBufferPointer { ptr in
            try body(&ptr)
        }
    }
