Class LayerMemoryReport
- java.lang.Object
-
- org.deeplearning4j.nn.conf.memory.MemoryReport
-
- org.deeplearning4j.nn.conf.memory.LayerMemoryReport
-
public class LayerMemoryReport extends MemoryReport
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LayerMemoryReport.Builder
-
Field Summary
-
Fields inherited from class org.deeplearning4j.nn.conf.memory.MemoryReport
CACHE_MODE_ALL_ZEROS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LayerMemoryReport(LayerMemoryReport.Builder b)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode, DataType dataType)
Get the memory estimate (in bytes) for the specified type of memoryString
getName()
Name of the object that the memory report was generated forClass<?>
getReportClass()
long
getTotalMemoryBytes(int minibatchSize, @NonNull MemoryUseMode memoryUseMode, @NonNull CacheMode cacheMode, @NonNull DataType dataType)
Get the total memory use in bytes for the given configurationvoid
scale(int scale)
Multiply all memory usage by the specified scaling factorString
toString()
-
Methods inherited from class org.deeplearning4j.nn.conf.memory.MemoryReport
cacheModeMapFor, fromJson, fromYaml, getBytesPerElement, getMemoryBytes, getTotalMemoryBytes, toJson, toYaml
-
-
-
-
Constructor Detail
-
LayerMemoryReport
protected LayerMemoryReport(LayerMemoryReport.Builder b)
-
-
Method Detail
-
getReportClass
public Class<?> getReportClass()
- Specified by:
getReportClass
in classMemoryReport
- Returns:
- Class that the memory report was generated for
-
getName
public String getName()
Description copied from class:MemoryReport
Name of the object that the memory report was generated for- Specified by:
getName
in classMemoryReport
- Returns:
- Name of the object
-
getTotalMemoryBytes
public long getTotalMemoryBytes(int minibatchSize, @NonNull @NonNull MemoryUseMode memoryUseMode, @NonNull @NonNull CacheMode cacheMode, @NonNull @NonNull DataType dataType)
Description copied from class:MemoryReport
Get the total memory use in bytes for the given configuration- Specified by:
getTotalMemoryBytes
in classMemoryReport
- Parameters:
minibatchSize
- Mini batch size to estimate the memory formemoryUseMode
- The memory use mode (training or inference)cacheMode
- The CacheMode to usedataType
- Nd4j datatype- Returns:
- The estimated total memory consumption in bytes
-
getMemoryBytes
public long getMemoryBytes(MemoryType memoryType, int minibatchSize, MemoryUseMode memoryUseMode, CacheMode cacheMode, DataType dataType)
Description copied from class:MemoryReport
Get the memory estimate (in bytes) for the specified type of memory- Specified by:
getMemoryBytes
in classMemoryReport
- Parameters:
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 datatype- Returns:
- Estimated memory use for the given memory type
-
toString
public String toString()
- Specified by:
toString
in classMemoryReport
-
scale
public void scale(int scale)
Multiply all memory usage by the specified scaling factor- Parameters:
scale
- Scale factor to multiply all memory usage by
-
-