             }
         }
         
-//        singletons = shape.map { Int($0 == 1) }
-//        fixedDims = tensor.fixedDims
-        
         self.fixedDims = [Int](repeating: -1, count: self.stride.count)
         
         dimIndex = storage.calculateOrder(shape.count)
         self.view = ViewType(shape: shape, offset: tensor.view.offset)
     }
 
+    // FIXME: currently does not match other version of calculateOffset
     open func calculateOffset() -> Int {
         var pos = 0
         for i in 0..<shape.count {

    }
}

public func ones<S:Storage>(_ shape:Extent) -> Tensor<S> {
    return Tensor<S>(shape, value: S.ElementType(1))
}

    // convenience variable to access the shape of the view
    open var shape:Extent {
        get { return view.shape }
        
        // TODO: check, this may be a bad thing to do.. call reshape here? or get rid of.
        set {
            precondition(view.shape.elements == newValue.elements, "Number of elements must match")
            view.shape = newValue
