Static asserts to check for matching NumDimensions
This commit is contained in:
		
							parent
							
								
									283dec7f25
								
							
						
					
					
						commit
						b2cb49e280
					
				| @ -299,6 +299,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp | ||||
|     EIGEN_DEVICE_FUNC | ||||
|     EIGEN_STRONG_INLINE Tensor(const TensorBase<OtherDerived, ReadOnlyAccessors>& other) | ||||
|     { | ||||
|       EIGEN_STATIC_ASSERT(OtherDerived::NumDimensions == Base::NumDimensions, Number_of_dimensions_must_match) | ||||
|       typedef TensorAssignOp<Tensor, const OtherDerived> Assign; | ||||
|       Assign assign(*this, other.derived()); | ||||
|       resize(TensorEvaluator<const Assign, DefaultDevice>(assign, DefaultDevice()).dimensions()); | ||||
| @ -309,6 +310,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp | ||||
|     EIGEN_DEVICE_FUNC | ||||
|     EIGEN_STRONG_INLINE Tensor(const TensorBase<OtherDerived, WriteAccessors>& other) | ||||
|     { | ||||
|       EIGEN_STATIC_ASSERT(OtherDerived::NumDimensions == Base::NumDimensions, Number_of_dimensions_must_match) | ||||
|       typedef TensorAssignOp<Tensor, const OtherDerived> Assign; | ||||
|       Assign assign(*this, other.derived()); | ||||
|       resize(TensorEvaluator<const Assign, DefaultDevice>(assign, DefaultDevice()).dimensions()); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Tobias Wood
						Tobias Wood