@Name(value="caffe::Blob<float>") @NoOffset @Properties(inherit=caffe.class) public class FloatBlob extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
FloatBlob() |
FloatBlob(int[] shape) |
FloatBlob(IntBuffer shape) |
FloatBlob(int num,
int channels,
int height,
int width)
\brief Deprecated; use
Blob(const vector . |
FloatBlob(IntPointer shape) |
FloatBlob(long size)
Native array allocator.
|
FloatBlob(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
float |
asum_data()
\brief Compute the sum of absolute values (L1 norm) of the data.
|
float |
asum_diff()
\brief Compute the sum of absolute values (L1 norm) of the diff.
|
int |
CanonicalAxisIndex(int axis_index)
\brief Returns the 'canonical' version of a (usually) user-specified axis,
allowing for negative indexing (e.g., -1 for the last axis).
|
int |
channels()
\brief Deprecated legacy shape accessor channels: use shape(1) instead.
|
void |
CopyFrom(FloatBlob source) |
void |
CopyFrom(FloatBlob source,
boolean copy_diff,
boolean reshape)
\brief Copy from a source Blob.
|
int |
count() |
int |
count(int start_axis)
\brief Compute the volume of a slice spanning from a particular first
axis to the final axis.
|
int |
count(int start_axis,
int end_axis)
\brief Compute the volume of a slice; i.e., the product of dimensions
among a range of axes.
|
FloatPointer |
cpu_data() |
FloatPointer |
cpu_diff() |
float |
data_at(int[] index) |
float |
data_at(IntBuffer index) |
float |
data_at(int n,
int c,
int h,
int w) |
float |
data_at(IntPointer index) |
SyncedMemory |
data() |
float |
diff_at(int[] index) |
float |
diff_at(IntBuffer index) |
float |
diff_at(int n,
int c,
int h,
int w) |
float |
diff_at(IntPointer index) |
SyncedMemory |
diff() |
void |
FromProto(BlobProto proto) |
void |
FromProto(BlobProto proto,
boolean reshape) |
FloatBlob |
getPointer(long i) |
FloatPointer |
gpu_data() |
FloatPointer |
gpu_diff() |
IntPointer |
gpu_shape() |
int |
height()
\brief Deprecated legacy shape accessor height: use shape(2) instead.
|
int |
LegacyShape(int index) |
FloatPointer |
mutable_cpu_data() |
FloatPointer |
mutable_cpu_diff() |
FloatPointer |
mutable_gpu_data() |
FloatPointer |
mutable_gpu_diff() |
int |
num_axes() |
int |
num()
\brief Deprecated legacy shape accessor num: use shape(0) instead.
|
int |
offset(int n) |
int |
offset(int[] indices) |
int |
offset(IntBuffer indices) |
int |
offset(int n,
int c,
int h,
int w) |
int |
offset(IntPointer indices) |
FloatBlob |
position(long position) |
void |
Reshape(BlobShape shape) |
void |
Reshape(int[] shape) |
void |
Reshape(IntBuffer shape) |
void |
Reshape(int num,
int channels,
int height,
int width)
\brief Deprecated; use
Reshape(const vector . |
void |
Reshape(IntPointer shape)
\brief Change the dimensions of the blob, allocating new memory if
necessary.
|
void |
ReshapeLike(FloatBlob other) |
void |
scale_data(float scale_factor)
\brief Scale the blob data by a constant factor.
|
void |
scale_diff(float scale_factor)
\brief Scale the blob diff by a constant factor.
|
void |
set_cpu_data(float[] data) |
void |
set_cpu_data(FloatBuffer data) |
void |
set_cpu_data(FloatPointer data) |
void |
set_gpu_data(float[] data) |
void |
set_gpu_data(FloatBuffer data) |
void |
set_gpu_data(FloatPointer data) |
BytePointer |
shape_string() |
IntPointer |
shape() |
int |
shape(int index)
\brief Returns the dimension of the index-th axis (or the negative index-th
axis from the end, if index is negative).
|
boolean |
ShapeEquals(BlobProto other) |
void |
ShareData(FloatBlob other)
\brief Set the data_ shared_ptr to point to the SyncedMemory holding the
data_ of Blob other -- useful in Layer%s which simply perform a copy
in their Forward pass.
|
void |
ShareDiff(FloatBlob other)
\brief Set the diff_ shared_ptr to point to the SyncedMemory holding the
diff_ of Blob other -- useful in Layer%s which simply perform a copy
in their Forward pass.
|
float |
sumsq_data()
\brief Compute the sum of squares (L2 norm squared) of the data.
|
float |
sumsq_diff()
\brief Compute the sum of squares (L2 norm squared) of the diff.
|
void |
ToProto(BlobProto proto) |
void |
ToProto(BlobProto proto,
boolean write_diff) |
void |
Update() |
int |
width()
\brief Deprecated legacy shape accessor width: use shape(3) instead.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public FloatBlob(Pointer p)
Pointer(Pointer)
.public FloatBlob(long size)
Pointer.position(long)
.public FloatBlob()
public FloatBlob(int num, int channels, int height, int width)
Blob(const vector& shape)
.public FloatBlob(@StdVector IntPointer shape)
public FloatBlob(@StdVector IntBuffer shape)
public FloatBlob(@StdVector int[] shape)
public FloatBlob getPointer(long i)
getPointer
in class Pointer
public void Reshape(int num, int channels, int height, int width)
Reshape(const vector& shape)
.public void Reshape(@StdVector IntPointer shape)
public void Reshape(@StdVector IntBuffer shape)
public void Reshape(@StdVector int[] shape)
@StdString public BytePointer shape_string()
@StdVector public IntPointer shape()
public int shape(int index)
index
- the axis index, which may be negative as it will be
"canonicalized" using CanonicalAxisIndex.
Dies on out of range index.public int num_axes()
public int count()
public int count(int start_axis, int end_axis)
start_axis
- The first axis to include in the slice.end_axis
- The first axis to exclude from the slice.public int count(int start_axis)
start_axis
- The first axis to include in the slice.public int CanonicalAxisIndex(int axis_index)
axis_index
- the axis index.
If 0 <= index < num_axes(), return index.
If -num_axes <= index <= -1, return (num_axes() - (-index)),
e.g., the last axis index (num_axes() - 1) if index == -1,
the second to last if index == -2, etc.
Dies on out of range index.public int num()
public int channels()
public int height()
public int width()
public int LegacyShape(int index)
public int offset(int n, int c, int h, int w)
public int offset(int n)
public int offset(@StdVector IntPointer indices)
public int offset(@StdVector IntBuffer indices)
public int offset(@StdVector int[] indices)
public void CopyFrom(@Const @ByRef FloatBlob source, @Cast(value="bool") boolean copy_diff, @Cast(value="bool") boolean reshape)
source
- the Blob to copy fromcopy_diff
- if false, copy the data; if true, copy the diffreshape
- if false, require this Blob to be pre-shaped to the shape
of other (and die otherwise); if true, Reshape this Blob to other's
shape if necessarypublic float data_at(int n, int c, int h, int w)
public float diff_at(int n, int c, int h, int w)
public float data_at(@StdVector IntPointer index)
public float data_at(@StdVector IntBuffer index)
public float data_at(@StdVector int[] index)
public float diff_at(@StdVector IntPointer index)
public float diff_at(@StdVector IntBuffer index)
public float diff_at(@StdVector int[] index)
@SharedPtr public SyncedMemory data()
@SharedPtr public SyncedMemory diff()
@Const public FloatPointer cpu_data()
public void set_cpu_data(FloatPointer data)
public void set_cpu_data(FloatBuffer data)
public void set_cpu_data(float[] data)
@Const public IntPointer gpu_shape()
@Const public FloatPointer gpu_data()
public void set_gpu_data(FloatPointer data)
public void set_gpu_data(FloatBuffer data)
public void set_gpu_data(float[] data)
@Const public FloatPointer cpu_diff()
@Const public FloatPointer gpu_diff()
public FloatPointer mutable_cpu_data()
public FloatPointer mutable_gpu_data()
public FloatPointer mutable_cpu_diff()
public FloatPointer mutable_gpu_diff()
public void Update()
public void ToProto(BlobProto proto)
public float asum_data()
public float asum_diff()
public float sumsq_data()
public float sumsq_diff()
public void scale_data(float scale_factor)
public void scale_diff(float scale_factor)
public void ShareData(@Const @ByRef FloatBlob other)
public void ShareDiff(@Const @ByRef FloatBlob other)
Copyright © 2022. All rights reserved.