Signed-off-by: raver119@gmail.com <raver119@gmail.com>master
parent
320924278d
commit
2849299bfb
|
@ -5341,7 +5341,7 @@ public abstract class BaseNDArray implements INDArray, Iterable {
|
|||
|
||||
if (!this.isView()) {
|
||||
Nd4j.getExecutioner().commit();
|
||||
DataBuffer buffer = Nd4j.createBuffer(this.length(), false);
|
||||
DataBuffer buffer = Nd4j.createBuffer(this.dataType(), this.length(), false);
|
||||
Nd4j.getMemoryManager().memcpy(buffer, this.data());
|
||||
|
||||
copy = Nd4j.createArrayFromShapeBuffer(buffer, this.shapeInfoDataBuffer());
|
||||
|
|
|
@ -425,6 +425,21 @@ public class SpecialWorkspaceTests extends BaseNd4jTest {
|
|||
Files.delete(tmpFile);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testMigrateToWorkspace(){
|
||||
val src = Nd4j.createFromArray (1L,2L);
|
||||
val wsConf = new WorkspaceConfiguration().builder().build();
|
||||
Nd4j.getWorkspaceManager().createNewWorkspace(wsConf,"testWS");
|
||||
val ws = Nd4j.getWorkspaceManager().getAndActivateWorkspace("testWS");
|
||||
|
||||
val migrated = src.migrate();
|
||||
assertEquals(src.dataType(), migrated.dataType());
|
||||
assertEquals(1L, migrated.getLong(0));
|
||||
|
||||
ws.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public char ordering() {
|
||||
return 'c';
|
||||
|
|
Loading…
Reference in New Issue