INDArray javadocs (#166)
* small fix of compiler warnings in nd4j. Signed-off-by: Robert Altena <Rob@Ra-ai.com> * indarray javadoc start. Signed-off-by: Robert Altena <Rob@Ra-ai.com>master
parent
daf5420f4c
commit
9a513a9aa6
|
@ -142,21 +142,11 @@ public abstract class BaseNDArray implements INDArray, Iterable {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this array is compressed, and false otherwise
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean isCompressed() {
|
||||
return compressed;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method marks INDArray instance as compressed
|
||||
* PLEASE NOTE: Do not use this method unless you 100% have to
|
||||
*
|
||||
* @param reallyCompressed
|
||||
*/
|
||||
@Override
|
||||
public void markAsCompressed(boolean reallyCompressed) {
|
||||
this.compressed = reallyCompressed;
|
||||
|
@ -949,17 +939,6 @@ public abstract class BaseNDArray implements INDArray, Iterable {
|
|||
|
||||
@Override
|
||||
public int elementWiseStride() {
|
||||
/*
|
||||
if(Shape.elementWiseStride(shapeInfo()) < 0 && !attemptedToFindElementWiseStride) {
|
||||
INDArray reshapeAttempt = Shape.newShapeNoCopy(this,new int[]{1,length()}, ordering() == 'f');
|
||||
if(reshapeAttempt != null && reshapeAttempt.elementWiseStride() > 0) {
|
||||
Shape.setElementWiseStride(shapeInfo(), reshapeAttempt.stride(-1));
|
||||
this.shapeInformation = Nd4j.getShapeInfoProvider().createShapeInformation(shape(), stride(), offset(),reshapeAttempt.stride(-1), ordering());
|
||||
}
|
||||
attemptedToFindElementWiseStride = true;
|
||||
|
||||
}
|
||||
*/
|
||||
return Shape.elementWiseStride(shapeInfoDataBuffer());
|
||||
}
|
||||
|
||||
|
@ -5349,12 +5328,6 @@ public abstract class BaseNDArray implements INDArray, Iterable {
|
|||
return jvmShapeInfo.shape;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shape information debugging
|
||||
* information
|
||||
*
|
||||
* @return the shape information debugging information
|
||||
*/
|
||||
@Override
|
||||
public String shapeInfoToString() {
|
||||
return Shape.shapeToString(this);
|
||||
|
|
|
@ -328,13 +328,11 @@ public abstract class BaseSparseNDArray implements ISparseNDArray {
|
|||
return sparseInformation;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LongBuffer shapeInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCompressed() {
|
||||
return false;
|
||||
|
@ -364,7 +362,6 @@ public abstract class BaseSparseNDArray implements ISparseNDArray {
|
|||
return Shape.sparseOffsets(sparseInformation);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int stride(int dimension) {
|
||||
int rank = Shape.rank(shapeInformation);
|
||||
|
|
|
@ -41,45 +41,44 @@ import org.nd4j.linalg.string.NDArrayStrings;
|
|||
*/
|
||||
public interface INDArray extends Serializable, AutoCloseable {
|
||||
/**
|
||||
* Returns the shape information debugging
|
||||
* information
|
||||
* @return the shape information debugging information
|
||||
* Returns the shape information debugging information
|
||||
* @return the shape information.
|
||||
*/
|
||||
String shapeInfoToString();
|
||||
|
||||
/**
|
||||
* Shape info
|
||||
* @return
|
||||
* @return Shape info
|
||||
*/
|
||||
DataBuffer shapeInfoDataBuffer();
|
||||
|
||||
/**
|
||||
* Sparse info
|
||||
* @return
|
||||
* @return Sparse info.
|
||||
*/
|
||||
DataBuffer sparseInfoDataBuffer();
|
||||
|
||||
/**
|
||||
* Shape info
|
||||
* @return
|
||||
* @return Shape info
|
||||
*/
|
||||
LongBuffer shapeInfo();
|
||||
|
||||
/**
|
||||
* Returns true if this array is a view or not
|
||||
* @return
|
||||
* Check if this array is a view or not.
|
||||
* @return true if array is a view.
|
||||
*/
|
||||
boolean isView();
|
||||
|
||||
/**
|
||||
* Returns true if this array is sparse
|
||||
* @return
|
||||
* Check if this array is sparse
|
||||
* @return true if this array is sparse.
|
||||
*/
|
||||
boolean isSparse();
|
||||
|
||||
/**
|
||||
* Returns true if this array is compressed, and false otherwise
|
||||
* @return
|
||||
* Check if this array is compressed.
|
||||
* @return true if this array is compressed.
|
||||
*/
|
||||
boolean isCompressed();
|
||||
|
||||
|
@ -87,11 +86,10 @@ public interface INDArray extends Serializable, AutoCloseable {
|
|||
* This method marks INDArray instance as compressed
|
||||
* PLEASE NOTE: Do not use this method unless you 100% have to
|
||||
*
|
||||
* @param reallyCompressed
|
||||
* @param reallyCompressed new value for compressed.
|
||||
*/
|
||||
void markAsCompressed(boolean reallyCompressed);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the rank of the ndarray (the number of dimensions).
|
||||
*
|
||||
|
|
|
@ -103,7 +103,6 @@ import java.text.NumberFormat;
|
|||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
@ -153,7 +152,6 @@ public class Nd4j {
|
|||
public static RandomFactory randomFactory;
|
||||
private static MemoryWorkspaceManager workspaceManager;
|
||||
private static DeallocatorService deallocatorService;
|
||||
private static final AtomicInteger numThreads = new AtomicInteger(-1);
|
||||
private static AtomicReference<DataType> defaultFloatingPointDataType;
|
||||
|
||||
private static DataBufferFactory DATA_BUFFER_FACTORY_INSTANCE;
|
||||
|
@ -4755,7 +4753,7 @@ public class Nd4j {
|
|||
* @param toStrip the ndarray to newShapeNoCopy
|
||||
* @return the reshaped ndarray
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess") // Needs tests if part of public API.
|
||||
@SuppressWarnings({"unused"}) // Needs tests if part of public API.
|
||||
public static INDArray stripOnes(INDArray toStrip) {
|
||||
if (toStrip.isVector())
|
||||
return toStrip;
|
||||
|
|
Loading…
Reference in New Issue