Abaqus - How to apply initial conditions as plastic strain? - abaqus

I m trying to apply to apply plastic strains initial conditions in Abaqus as you can see below : 
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, -0.276, -0.0618, 0.0447
**
** STEP: Step-1
This part of code works in case of Stresses but not for plastic strains... The calculation presents no errors, abaqus runs but when i check the results, it doesnt consider my plastic strain...
----EDIT LATER---
An example of INP file :
*Heading
** Job name: dernier1 Model name: test_plastic
** Generated by: Abaqus/CAE 6.13-1
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1-1
*Node
1, 0., -13.75, 3.
2, -15., -13.75, 3.
3, -30., -13.75, 3.
4, 0., -13.75, 0.
5, -15., -13.75, 0.
6, -30., -13.75, 0.
7, 0., 2.5, 3.
8, -15.3125, 2.5, 3.
9, -30.625, 2.5, 3.
10, 0., 2.5, 0.
11, -15.3125, 2.5, 0.
12, -30.625, 2.5, 0.
13, 0., 18.75, 3.
14, -15.625, 18.75, 3.
15, -31.25, 18.75, 3.
16, 0., 18.75, 0.
17, -15.625, 18.75, 0.
18, -31.25, 18.75, 0.
*Element, type=C3D8R
1, 7, 8, 11, 10, 1, 2, 5, 4
2, 8, 9, 12, 11, 2, 3, 6, 5
3, 13, 14, 17, 16, 7, 8, 11, 10
4, 14, 15, 18, 17, 8, 9, 12, 11
*Nset, nset=SET-1, generate
1, 18, 1
*Elset, elset=SET-1, generate
1, 4, 1
** Section: Section-1-SET-1
*Solid Section, elset=SET-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1-1
*End Instance
**
*Nset, nset=SET-1, instance=PART-1-1, generate
1, 6, 1
*Elset, elset=SET-1, instance=PART-1-1
1, 2
*Elset, elset="test_elements", instance=PART-1-1
1, 2
*Elset, elset=_SURF-1_S1, internal, instance=PART-1-1
3, 4
*Elset, elset=_SURF-1_S1_1, internal, instance=PART-1-1
3, 4
*Surface, type=ELEMENT, name=SURF-1
_SURF-1_S1_1, S1
*End Assembly
*Amplitude, name=AMP-1, time=TOTAL TIME, definition=PERIODIC
1, 5., 0., 0.
5., 1.
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
140000., 0.28
*Plastic
50., 0.
100., 0.2
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, 0., 0., 0.
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
5., 5., 5e-05, 5.
**
** BOUNDARY CONDITIONS
**
** Name: Disp-BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
SET-1, ENCASTRE
**
** LOADS
**
** Name: SURFFORCE-1 Type: Pressure
*Dsload, amplitude=AMP-1
SURF-1, P, -5
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step

So the only problem to get this to run was the extra set of quotes on test_elements? Not sure what the remaining problem is?
*Heading
** Job name: dernier1 Model name: test_plastic
** Generated by: Abaqus/CAE 6.13-1
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
**
*Node
1, 0., -13.75, 3.
2, -15., -13.75, 3.
3, -30., -13.75, 3.
4, 0., -13.75, 0.
5, -15., -13.75, 0.
6, -30., -13.75, 0.
7, 0., 2.5, 3.
8, -15.3125, 2.5, 3.
9, -30.625, 2.5, 3.
10, 0., 2.5, 0.
11, -15.3125, 2.5, 0.
12, -30.625, 2.5, 0.
13, 0., 18.75, 3.
14, -15.625, 18.75, 3.
15, -31.25, 18.75, 3.
16, 0., 18.75, 0.
17, -15.625, 18.75, 0.
18, -31.25, 18.75, 0.
*Element, type=C3D8R
1, 7, 8, 11, 10, 1, 2, 5, 4
2, 8, 9, 12, 11, 2, 3, 6, 5
3, 13, 14, 17, 16, 7, 8, 11, 10
4, 14, 15, 18, 17, 8, 9, 12, 11
*Nset, nset=SET-1, generate
1, 18, 1
*Elset, elset=SET-1, generate
1, 4, 1
** Section: Section-1-SET-1
*Solid Section, elset=SET-1, material=MATERIAL-1
,
**
*Nset, nset=SET-1, generate
1, 6, 1
*Elset, elset=SET-1
1, 2
*Elset, elset=test_elements
1, 2
*Elset, elset=_SURF-1_S1
3, 4
*Elset, elset=_SURF-1_S1_1
3, 4
*Surface, type=ELEMENT, name=SURF-1
_SURF-1_S1_1, S1
*End Assembly
*Amplitude, name=AMP-1, time=TOTAL TIME, definition=PERIODIC
1, 5., 0., 0.
5., 1.
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
140000., 0.28
*Plastic
50., 0.
100., 0.2
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, 0., 0., 0.
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
5., 5., 5e-05, 5.
**
** BOUNDARY CONDITIONS
**
** Name: Disp-BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
SET-1, ENCASTRE
**
** LOADS
**
** Name: SURFFORCE-1 Type: Pressure
*Dsload, amplitude=AMP-1
SURF-1, P, -5
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step

Related

How to define the nodes and elements in ABAQUS input file?

I have edited an ABAQUS input file generated from the maple code written to create a 3D model for analysis. The input file is missing the nodes and element definitions. Can someone give me some example on how to edit the following code to input the model for analysis.
*HEADING
Woven Unit Cell
***NODE DEFINITION***
*NODE, NSET=NALL
***ELEMENT DEFINITION***
***MATRIX***
*ELEMENT, TYPE=C3D8, ELSET=MATRIX
***FIBERS***
*ELEMENT, TYPE=C3D8, ELSET=FIBER1
*ELEMENT, TYPE=C3D8, ELSET=FIBER2
*ELEMENT, TYPE=C3D8, ELSET=FIBER3
*ELEMENT, TYPE=C3D8, ELSET=FIBER4
*MATERIAL, NAME=MMATRIX
*ELASTIC, TYPE=ISOTROPIC
3.45E+9, 0.35
*MATERIAL, NAME=MFIBER1
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER2
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER3
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER4
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*SOLID SECTION, ELSET=MATRIX, MATERIAL=MMATRIX
*SOLID SECTION, ELSET=FIBER1, MATERIAL=MFIBER1, ORIENTATION=FTRANS
*SOLID SECTION, ELSET=FIBER2, MATERIAL=MFIBER2, ORIENTATION=FTRANS
*SOLID SECTION, ELSET=FIBER3, MATERIAL=MFIBER3, ORIENTATION=FLONG
*SOLID SECTION, ELSET=FIBER4, MATERIAL=MFIBER4, ORIENTATION=FLONG
*ORIENTATION, NAME=FLONG, SYSTEM=RECTANGULAR, DEFINITION=COORDINATES
1., 0., 0., 0., 1., 0.
*ORIENTATION, NAME=FTRANS, SYSTEM=RECTANGULAR, DEFINITION=COORDINATES
0., 1., 0., -1., 0., 0.
***NODE SETS***
*NSET, NSET=BASE
*NSET, NSET=TOP
*NSET, NSET=XMIN
*NSET, NSET=XMAX
*NSET, NSET=YMIN
*NSET, NSET=YMAX
*STEP, NLGEOM
*STATIC
*RESTART, WRITE, FREQ=1
***BOUNDARY CONDITIONS***
*BOUNDARY
BASE,3,,0.
TOP,3,,0.
XMIN,1,,0.
XMAX,1,,0.001
YMIN,2,,0.
YMAX,2,,0.
***NODE SET DEFINITION***
*ELSET, ELSET=ALLF
FIBER1,FIBER2,FIBER3,FIBER4
*END STEP
An ID followed by the coordinates identifies each node.
For one C3D8 element you need at least 8 nodes. For instance:
*NODE, NSET=NALL
1, 1., 1., 1.
2, 1., 0., 1.
3, 1., 1., 0.
4, 1., 0., 0.
5, 0., 1., 1.
6, 0., 0., 1.
7, 0., 1., 0.
8, 0., 0., 0.
Similarly, each element has an ID and the nodes in the right order.
Each C3D8 element can be created as, for instance:
*ELEMENT, TYPE=C3D8, ELSET=MATRIX
1, 5, 6, 8, 7, 1, 2, 4, 3
This scheme may help you.
** 8-node 7-----------3
** /| /|
** / | / | y
** 5-----------1 | |
** | | | | |
** | | | | |
** | 8--------|--4 0-----> x
** | / | / /
** |/ |/ /
** 6-----------2 z origin at node 8

How to export global load vector in abaqus

In FEM, we needs to solve K*u=P, where K is global stiffness matrix, u is displacement, P is global load vector.
I want export global load vector, that is P.
I have a read at the manual, I add follow lines into the inp file.
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
*END STEP
After add the lines, then run the inp file, I can export the global stiffness matrix, I can see a "Job-1_STIF2.mtx" in the work directory, but there is nothing relate to global load vector. I do not know why the load vector can not be export.
Can anyone help me? Could you please modify my inp file? Or give any suggestions? Or give me an example inp that can export global load vector? Thanks for your time.
The full inp file shown as follow
*Heading
** Job name: Job-1 Model name: Job_my
** Generated by: Abaqus/CAE 2016
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1
*Node
1, 0., 0., 0.
2, 0., 10., 0.
3, 10., 0., 0.
4, 10., 10., 0.
5, 0., 0., 5.
6, 0., 10., 5.
7, 10., 0., 5.
8, 10., 10., 5.
9, 0., 0., 10.
10, 0., 10., 10.
11, 10., 0., 10.
12, 10., 10., 10.
*Element, type=C3D4
1, 1, 3, 4, 8
2, 1, 3, 8, 5
3, 3, 8, 5, 7
4, 6, 5, 1, 8
5, 6, 1, 2, 4
6, 6, 1, 4, 8
7, 5, 7, 8, 12
8, 5, 7, 12, 9
9, 7, 12, 9, 11
10, 10, 9, 5, 12
11, 10, 5, 6, 8
12, 10, 5, 8, 12
*Elset, elset=Set-1, generate
1, 12, 1
** Section: Section-1
*Solid Section, elset=Set-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1
*End Instance
**
*Nset, nset=Set-1, instance=PART-1-1, generate
1, 4, 1
*Nset, nset=Set-2, instance=PART-1-1
1, 2, 5, 6, 9, 10
*Nset, nset=Set-3, instance=PART-1-1, generate
1, 11, 2
*Elset, elset=_Surf-1_S2, internal, instance=PART-1-1
10,
*Elset, elset=_Surf-1_S3, internal, instance=PART-1-1
9,
*Surface, type=ELEMENT, name=Surf-1
_Surf-1_S2, S2
_Surf-1_S3, S3
*End Assembly
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
100.,0.3
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Displacement/Rotation
*Boundary
Set-1, 3, 3
** Name: BC-2 Type: Displacement/Rotation
*Boundary
Set-2, 1, 1
** Name: BC-3 Type: Displacement/Rotation
*Boundary
Set-3, 2, 2
** ----------------------------------------------------------------
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
1., 1., 1e-05, 1.
*Element Matrix Output,ELSET=PART-1-1.Set-1,
DLOAD=YES,File Name=element_matrix_vector,Frequency=1,Output File=User Defined,Stiffness=Yes,Mass=Yes
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
*END STEP
The load should also be defined in the step which export the matrix.
That is, the line add to generate global system matrix should be:
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
*END STEP
full inp file shown as follows:
*Heading
** Job name: Job-1 Model name: Job_my
** Generated by: Abaqus/CAE 2016
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1
*Node
1, 0., 0., 0.
2, 0., 10., 0.
3, 10., 0., 0.
4, 10., 10., 0.
5, 0., 0., 5.
6, 0., 10., 5.
7, 10., 0., 5.
8, 10., 10., 5.
9, 0., 0., 10.
10, 0., 10., 10.
11, 10., 0., 10.
12, 10., 10., 10.
*Element, type=C3D4
1, 1, 3, 4, 8
2, 1, 3, 8, 5
3, 3, 8, 5, 7
4, 6, 5, 1, 8
5, 6, 1, 2, 4
6, 6, 1, 4, 8
7, 5, 7, 8, 12
8, 5, 7, 12, 9
9, 7, 12, 9, 11
10, 10, 9, 5, 12
11, 10, 5, 6, 8
12, 10, 5, 8, 12
*Elset, elset=Set-1, generate
1, 12, 1
** Section: Section-1
*Solid Section, elset=Set-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1
*End Instance
**
*Nset, nset=Set-1, instance=PART-1-1, generate
1, 4, 1
*Nset, nset=Set-2, instance=PART-1-1
1, 2, 5, 6, 9, 10
*Nset, nset=Set-3, instance=PART-1-1, generate
1, 11, 2
*Elset, elset=_Surf-1_S2, internal, instance=PART-1-1
10,
*Elset, elset=_Surf-1_S3, internal, instance=PART-1-1
9,
*Surface, type=ELEMENT, name=Surf-1
_Surf-1_S2, S2
_Surf-1_S3, S3
*End Assembly
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
100.,0.3
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Displacement/Rotation
*Boundary
Set-1, 3, 3
** Name: BC-2 Type: Displacement/Rotation
*Boundary
Set-2, 1, 1
** Name: BC-3 Type: Displacement/Rotation
*Boundary
Set-3, 2, 2
** ----------------------------------------------------------------
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
1., 1., 1e-05, 1.
*Element Matrix Output,ELSET=PART-1-1.Set-1,
DLOAD=YES,File Name=element_matrix_vector,Frequency=1,Output File=User Defined,Stiffness=Yes,Mass=Yes
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
*END STEP

How to zero pad on both sides and encode the sequence into one hot in keras?

I have text data as follows.
X_train_orignal= np.array(['OC(=O)C1=C(Cl)C=CC=C1Cl', 'OC(=O)C1=C(Cl)C=C(Cl)C=C1Cl',
'OC(=O)C1=CC=CC(=C1Cl)Cl', 'OC(=O)C1=CC(=CC=C1Cl)Cl',
'OC1=C(C=C(C=C1)[N+]([O-])=O)[N+]([O-])=O'])
As it is evident that different sequences have different length. How can I zero pad the sequence on both sides of the sequence to some maximum length. And then convert each sequence into one hot encoding based on each characters?
Try:
I used the following keras API but it doesn't work with strings sequence.
keras.preprocessing.sequence.pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncating='pre', value=0.0)
I might need to convert my sequence data into one hot vectors first and then zero pad it. For that I tried to use Tokanizeas follows.
tk = Tokenizer(nb_words=?, split=?)
But then, what should be the split value and nb_words as my sequence data doesn't have any space? How to use it for character based one hot?
MY overall goal is to zero pad my sequences and convert it to one hot before I feed it into RNN.
So i came across a way to do by using Tokenizer first and then pad_sequences to zero pad my sequence in the start as follows.
from keras.preprocessing.text import Tokenizer
tokenizer = Tokenizer(char_level=True)
tokenizer.fit_on_texts(X_train_orignal)
sequence_of_int = tokenizer.texts_to_sequences(X_train_orignal)
This gives me the output as follows.
[[3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 4, 1, 7, 5, 1, 2, 1, 1, 2, 1, 6, 1, 7],
[3,
1,
4,
2,
3,
5,
1,
6,
2,
1,
4,
1,
7,
5,
1,
2,
1,
4,
1,
7,
5,
1,
2,
1,
6,
1,
7],
[3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 1, 2, 1, 1, 4, 2, 1, 6, 1, 7, 5, 1, 7],
[3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 1, 4, 2, 1, 1, 2, 1, 6, 1, 7, 5, 1, 7],
[3,
1,
6,
2,
1,
4,
1,
2,
1,
4,
1,
2,
1,
6,
5,
8,
10,
11,
9,
4,
8,
3,
12,
9,
5,
2,
3,
5,
8,
10,
11,
9,
4,
8,
3,
12,
9,
5,
2,
3]]
Now I do not understand why it is giving sequence_of_int[1], sequence_of_int[4] output in column format?
After getting the tokens, I applied the pad_sequences as follows.
seq=keras.preprocessing.sequence.pad_sequences(sequence_of_int, maxlen=None, dtype='int32', padding='pre', value=0.0)
and it gives me the output as follows.
array([[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 4, 1, 7, 5, 1,
2, 1, 1, 2, 1, 6, 1, 7],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 4,
2, 3, 5, 1, 6, 2, 1, 4, 1, 7, 5, 1, 2, 1, 4, 1,
7, 5, 1, 2, 1, 6, 1, 7],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 1, 2, 1, 1, 4,
2, 1, 6, 1, 7, 5, 1, 7],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 1, 4, 2, 3, 5, 1, 6, 2, 1, 1, 4, 2, 1, 1,
2, 1, 6, 1, 7, 5, 1, 7],
[ 3, 1, 6, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 6, 5, 8,
10, 11, 9, 4, 8, 3, 12, 9, 5, 2, 3, 5, 8, 10, 11, 9,
4, 8, 3, 12, 9, 5, 2, 3]], dtype=int32)
Then after that, I converted it into one hot as follows.
one_hot=keras.utils.to_categorical(seq)

How do i append another list within list comprehension

I am trying to find out unique elements and avoid duplicates , between the lists (using list comprehension)
`a = [10 , 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,9]`
`b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]`
dup_list = []
This works , but with duplicates
`final_list = [uniq for uniq in a if a not in dup_list if uniq in b ]`
when i try to append the my dup_list in the last line of the comprehension statement it says invalid syntax
i.e this doesn't work.
"final_list = [uniq for uniq in a if a not in dup_list if uniq in b dup_list.append(uniq) "
I am a newbie in python so apologize for any missed out basic facts .
a = [10, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 9]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
nodupes = sorted([item for item in a if item not in b] +
[item for item in b if item not in a])
That yields [4, 6, 7, 11, 12, 21, 34, 55, 89]
Which is the same answer I get using sets:
seta = set(a)
setb = set(b)
nodupes = sorted(list(seta ^ setb))

how to extract matrix from big matrix in torch/lua

In torch7 / lua
There is a matrix:
[ 1, 2, 3, 4;
5, 6, 7, 8;
9, 10, 11, 12;
13, 14, 15, 16 ]
how to extract this:
[ 6, 7;
10, 11 ]
and how to overwrite it by matrix operation
[ 1, 2, 3, 4;
5, 78, 66, 8;
9, 45, 21, 12;
13, 14, 15, 16 ]
Thanks in advance.
matrix
matrix:sub(2,3,2,3)
z = torch.Tensor({{78,66},{45,21}})
matrix:sub(2,3,2,3):copy(z)

Resources