control_py_env: Python controls

View source: R/utilities.R

control_py_envR Documentation

Python controls

Description

Interface to control variables in a Python environment possibly used by Infusion. Currently the only implemented control is that of the torch random seed.

Usage

control_py_env(py_handle, seed = NULL)

Arguments

py_handle

An R environment that provides access to a Python evaluation environment, as produced by get_py_MAF_handle

seed

Numeric: passed (as integer value) to torch.random.manual_seed.

Value

Returns NULL invisibly.

See Also

get_py_MAF_handle

Examples

# See help("get_py_MAF_handle") for basic usage

# The following test of the first argument may be useful in broader contexts:
## Not run: 
if (inherits(py_handle,"environment"))  control_py_env(py_handle, seed=0L)

## End(Not run)

mafR documentation built on May 7, 2026, 5:09 p.m.

Related to control_py_env in mafR...