Skip to content

Commit

Permalink
[system-a] remove TensorRankAbove2 and TensorRankAbove1
Browse files Browse the repository at this point in the history
- it is not good to limit input tensor, function should be fully extended
  • Loading branch information
xieyuheng committed May 29, 2024
1 parent efeeb85 commit 23644a9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/system-a/tensor/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ export function assertScalar(t: any): asserts t is Scalar {
}
}

export type TensorRankAbove1 = Array<Tensor>

export function assertTensorRankAbove1(x: any): asserts x is TensorRankAbove1 {
export function assertTensorRankAbove1(x: any): asserts x is Array<Tensor> {
if (x instanceof Array && x.every(isTensor)) {
return
}

throw new Error(`[assertTensorRankAbove1] ${x}`)
}

export type TensorRankAbove2 = Array<Array<Tensor>>

export function assertTensorAlmostEqual(
x: Tensor,
y: Tensor,
Expand Down

0 comments on commit 23644a9

Please sign in to comment.