public abstract class MemoryReport extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<CacheMode,Long> |
CACHE_MODE_ALL_ZEROS
A simple Map containing all zeros for each CacheMode key
|
| Constructor and Description |
|---|
MemoryReport() |
| Modifier and Type | Method and Description |
|---|---|
static Map<CacheMode,Long> |
cacheModeMapFor(long value)
Get a map of CacheMode with all keys associated with the specified value
|
static MemoryReport |
fromJson(String json) |
static MemoryReport |
fromYaml(String yaml) |
protected int |
getBytesPerElement(DataType dataType) |
long |
getMemoryBytes(MemoryType memoryType,
int minibatchSize,
MemoryUseMode memoryUseMode,
CacheMode cacheMode)
Get the memory estimate (in bytes) for the specified type of memory, using the current ND4J data type
|
abstract long |
getMemoryBytes(MemoryType memoryType,
int minibatchSize,
MemoryUseMode memoryUseMode,
CacheMode cacheMode,
DataType dataType)
Get the memory estimate (in bytes) for the specified type of memory
|
abstract String |
getName()
Name of the object that the memory report was generated for
|
abstract Class<?> |
getReportClass() |
long |
getTotalMemoryBytes(int minibatchSize,
@NonNull MemoryUseMode memoryUseMode,
@NonNull CacheMode cacheMode)
Get the total memory use in bytes for the given configuration (using the current ND4J data type)
|
abstract long |
getTotalMemoryBytes(int minibatchSize,
@NonNull MemoryUseMode memoryUseMode,
@NonNull CacheMode cacheMode,
@NonNull DataType dataType)
Get the total memory use in bytes for the given configuration
|
String |
toJson() |
abstract String |
toString() |
String |
toYaml() |
public abstract Class<?> getReportClass()
public abstract String getName()
public long getTotalMemoryBytes(int minibatchSize,
@NonNull
@NonNull MemoryUseMode memoryUseMode,
@NonNull
@NonNull CacheMode cacheMode)
minibatchSize - Mini batch size to estimate the memory formemoryUseMode - The memory use mode (training or inference)cacheMode - The CacheMode to usepublic abstract long getTotalMemoryBytes(int minibatchSize,
@NonNull
@NonNull MemoryUseMode memoryUseMode,
@NonNull
@NonNull CacheMode cacheMode,
@NonNull
@NonNull DataType dataType)
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)
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 usepublic abstract long getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode, DataType dataType)
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 datatypeprotected int getBytesPerElement(DataType dataType)
public static Map<CacheMode,Long> cacheModeMapFor(long value)
value - Value for all keyspublic String toJson()
public String toYaml()
public static MemoryReport fromJson(String json)
public static MemoryReport fromYaml(String yaml)
Copyright © 2021. All rights reserved.