foscat.backend#

Classes#

Module Contents#

class foscat.backend.foscat_backend(name, mpi_rank=0, all_type='float64', gpupos=0, silent=False)[source]#
TENSORFLOW = 1#
TORCH = 2#
NUMPY = 3#
BACKEND#
float64#
float32#
int64#
int32#
complex64#
complex128#
gpulist#
ngpu = 1#
tf_loc_function(func)[source]#
calc_iso_orient(norient)[source]#
calc_fft_orient(norient, nharm, imaginary)[source]#
bk_SparseTensor(indice, w, dense_shape=[])[source]#
bk_stack(list, axis=0)[source]#
bk_sparse_dense_matmul(smat, mat)[source]#
periodic_pad(x, pad_height, pad_width)[source]#

Applies periodic (‘wrap’) padding to a 4D TensorFlow tensor (N, H, W, C).

Args: x (tf.Tensor): Input tensor with shape (batch_size, height, width, channels).

pad_height (tuple): Tuple (top, bottom) defining the vertical padding size. pad_width (tuple): Tuple (left, right) defining the horizontal padding size.

Returns:

tf.Tensor: Tensor with periodic padding applied.

conv2d(x, w, strides=[1, 1, 1, 1], padding='SAME')[source]#
conv1d(x, w, strides=[1, 1, 1], padding='SAME')[source]#
bk_threshold(x, threshold, greater=True)[source]#
bk_maximum(x1, x2)[source]#
bk_device(device_name)[source]#
bk_ones(shape, dtype=None)[source]#
bk_conv1d(x, w)[source]#
bk_flattenR(x)[source]#
bk_flatten(x)[source]#
bk_resize_image(x, shape)[source]#
bk_L1(x)[source]#
bk_square_comp(x)[source]#
bk_reduce_sum(data, axis=None)[source]#
bk_size(data)[source]#
iso_mean(x, use_2D=False)[source]#
fft_ang(x, nharm=1, imaginary=False, use_2D=False)[source]#
constant(data)[source]#
bk_reduce_mean(data, axis=None)[source]#
bk_reduce_min(data, axis=None)[source]#
bk_random_seed(value)[source]#
bk_random_uniform(shape)[source]#
bk_reduce_std(data, axis=None)[source]#
bk_sqrt(data)[source]#
bk_abs(data)[source]#
bk_is_complex(data)[source]#
bk_distcomp(data)[source]#
bk_norm(data)[source]#
bk_square(data)[source]#
bk_log(data)[source]#
bk_matmul(a, b)[source]#
bk_tensor(data)[source]#
bk_shape_tensor(shape)[source]#
bk_complex(real, imag)[source]#
bk_exp(data)[source]#
bk_min(data)[source]#
bk_argmin(data)[source]#
bk_tanh(data)[source]#
bk_max(data)[source]#
bk_argmax(data)[source]#
bk_reshape(data, shape)[source]#
bk_repeat(data, nn, axis=0)[source]#
bk_tile(data, nn, axis=0)[source]#
bk_roll(data, nn, axis=0)[source]#
bk_expand_dims(data, axis=0)[source]#
bk_transpose(data, thelist)[source]#
bk_concat(data, axis=None)[source]#
bk_zeros(shape, dtype=None)[source]#
bk_gather(data, idx)[source]#
bk_reverse(data, axis=0)[source]#
bk_fft(data)[source]#
bk_fftn(data, dim=None)[source]#
bk_ifftn(data, dim=None, norm=None)[source]#
bk_rfft(data)[source]#
bk_irfft(data)[source]#
bk_conjugate(data)[source]#
bk_real(data)[source]#
bk_imag(data)[source]#
bk_relu(x)[source]#
bk_clip_by_value(x, xmin, xmax)[source]#
bk_cast(x)[source]#
bk_variable(x)[source]#
bk_assign(x, y)[source]#
bk_constant(x)[source]#
to_numpy(x)[source]#