File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ Class {
1111}
1212
1313{ #category : #' instance creation' }
14- PMTensor class >> newWith: anInteger [
14+ PMTensor class >> fromNestedArray: anArray [
1515
16- ^ self new array: {anInteger} withShape: #( )
16+ ^ self new array: anArray flattened withShape: ( self shape: anArray )
1717]
1818
1919{ #category : #' instance creation' }
20- PMTensor class >> rows: anArray [
20+ PMTensor class >> newWith: anInteger [
2121
22- ^ self new array: anArray flattened withShape: ( self shape: anArray )
22+ ^ self new array: {anInteger} withShape: #( )
2323]
2424
2525{ #category : #accessing }
@@ -58,6 +58,15 @@ PMTensor >> first [
5858^ first
5959]
6060
61+ { #category : #' as yet unclassified' }
62+ PMTensor >> flattenedIndexOf: aFlatArray withShape: aShape [
63+
64+ array := aFlatArray.
65+ shape := aShape copy.
66+ self updateFirst.
67+ shape ifNotEmpty: [ self updateStrides]
68+ ]
69+
6170{ #category : #public }
6271PMTensor >> get: coords [
6372
You can’t perform that action at this time.
0 commit comments