public class LayerMemoryReport extends MemoryReport
MemoryReport
Designed to report estimated memory use for a single layer or graph vertex.Modifier and Type | Class and Description |
---|---|
static class |
LayerMemoryReport.Builder |
CACHE_MODE_ALL_ZEROS
Modifier | Constructor and Description |
---|---|
protected |
LayerMemoryReport(LayerMemoryReport.Builder b) |
Modifier and Type | Method and Description |
---|---|
long |
getMemoryBytes(MemoryType memoryType,
int minibatchSize,
MemoryUseMode memoryUseMode,
CacheMode cacheMode,
org.nd4j.linalg.api.buffer.DataType dataType)
Get the memory estimate (in bytes) for the specified type of memory
|
String |
getName()
Name of the object that the memory report was generated for
|
Class<?> |
getReportClass() |
long |
getTotalMemoryBytes(int minibatchSize,
MemoryUseMode memoryUseMode,
CacheMode cacheMode,
org.nd4j.linalg.api.buffer.DataType dataType)
Get the total memory use in bytes for the given configuration
|
void |
scale(int scale)
Multiply all memory usage by the specified scaling factor
|
String |
toString() |
cacheModeMapFor, fromJson, fromYaml, getBytesPerElement, getMemoryBytes, getTotalMemoryBytes, toJson, toYaml
protected LayerMemoryReport(LayerMemoryReport.Builder b)
public Class<?> getReportClass()
getReportClass
in class MemoryReport
public String getName()
MemoryReport
getName
in class MemoryReport
public long getTotalMemoryBytes(int minibatchSize, @NonNull MemoryUseMode memoryUseMode, @NonNull CacheMode cacheMode, @NonNull org.nd4j.linalg.api.buffer.DataType dataType)
MemoryReport
getTotalMemoryBytes
in class MemoryReport
minibatchSize
- Mini batch size to estimate the memory formemoryUseMode
- The memory use mode (training or inference)cacheMode
- The CacheMode to usedataType
- Nd4j datatypepublic long getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode, org.nd4j.linalg.api.buffer.DataType dataType)
MemoryReport
getMemoryBytes
in class MemoryReport
memoryType
- Type of memory to get the estimate for invitesminibatchSize
- Mini batch size to estimate the memory formemoryUseMode
- The memory use mode (training or inference)cacheMode
- The CacheMode to usedataType
- Nd4j datatypepublic String toString()
toString
in class MemoryReport
public void scale(int scale)
scale
- Scale factor to multiply all memory usage byCopyright © 2019. All rights reserved.