code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
async def get_last_idle_time( self, session_id: Union[str, None] = None ) -> Union[float, None]: """ Get session last idle time. Parameters ---------- session_id : str, None Session ID. None for all sessions. Returns ------- last_...
Get session last idle time. Parameters ---------- session_id : str, None Session ID. None for all sessions. Returns ------- last_idle_time: str The last idle time if the session(s) is idle else None.
get_last_idle_time
python
mars-project/mars
mars/services/session/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/session/api/core.py
Apache-2.0
async def fetch_tileable_op_logs( self, session_id: str, tileable_op_key: str, chunk_op_key_to_offsets: Dict[str, List[int]], chunk_op_key_to_sizes: Dict[str, List[int]], ) -> Dict: """ Fetch tileable op's logs Parameters ---------- se...
Fetch tileable op's logs Parameters ---------- session_id : str Session ID. tileable_op_key : str Tileable op key. chunk_op_key_to_offsets : str or int or list of int Fetch offsets. chunk_op_key_to_sizes : str or int or list o...
fetch_tileable_op_logs
python
mars-project/mars
mars/services/session/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/session/api/core.py
Apache-2.0
async def has_session(self, session_id: str) -> bool: """ Check if session created. Parameters ---------- session_id : str Session ID. Returns ------- if_exists : bool """ return await self._session_manager_ref.has_session(ses...
Check if session created. Parameters ---------- session_id : str Session ID. Returns ------- if_exists : bool
has_session
python
mars-project/mars
mars/services/session/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/session/api/oscar.py
Apache-2.0
async def get_session_address(self, session_id: str) -> str: """ Get session address. Parameters ---------- session_id : str Session ID. Returns ------- address : str Session address. """ return (await self._sessio...
Get session address. Parameters ---------- session_id : str Session ID. Returns ------- address : str Session address.
get_session_address
python
mars-project/mars
mars/services/session/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/session/api/oscar.py
Apache-2.0
def record_put_info(self, key, data_size: int): """ Record the data key and data size when putting into storage """
Record the data key and data size when putting into storage
record_put_info
python
mars-project/mars
mars/services/storage/spill.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/spill.py
Apache-2.0
def record_delete_info(self, key): """ Record who is removed from storage """
Record who is removed from storage
record_delete_info
python
mars-project/mars
mars/services/storage/spill.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/spill.py
Apache-2.0
def get_spill_keys(self, size: int) -> Tuple[List, List]: """ Return sizes and keys for spilling according to spill size """
Return sizes and keys for spilling according to spill size
get_spill_keys
python
mars-project/mars
mars/services/storage/spill.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/spill.py
Apache-2.0
async def get( self, data_key: str, conditions: List = None, error: str = "raise" ) -> Any: """ Get object by data key. Parameters ---------- data_key: str date key to get. conditions: List Index conditions to pushdown error:...
Get object by data key. Parameters ---------- data_key: str date key to get. conditions: List Index conditions to pushdown error: str raise or ignore Returns ------- object
get
python
mars-project/mars
mars/services/storage/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/core.py
Apache-2.0
async def put( self, data_key: str, obj: object, level: StorageLevel = StorageLevel.MEMORY ) -> DataInfo: """ Put object into storage. Parameters ---------- data_key: str data key to put. obj: object object to put. level: Stora...
Put object into storage. Parameters ---------- data_key: str data key to put. obj: object object to put. level: StorageLevel the storage level to put into, MEMORY as default Returns ------- object information:...
put
python
mars-project/mars
mars/services/storage/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/core.py
Apache-2.0
async def get_infos(self, data_key: str) -> List[DataInfo]: """ Get data information items for specific data key Parameters ---------- data_key Returns ------- out List of information for specified key """
Get data information items for specific data key Parameters ---------- data_key Returns ------- out List of information for specified key
get_infos
python
mars-project/mars
mars/services/storage/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/core.py
Apache-2.0
async def create( cls: Type[APIType], session_id: str, address: str, band_name: str = "numa-0", **kwargs, ) -> APIType: """ Create storage API. Parameters ---------- session_id: str session id address: str ...
Create storage API. Parameters ---------- session_id: str session id address: str worker address band_name: str name of band, default as 'numa-0' Returns ------- storage_api Storage api.
create
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def get_infos(self, data_key: str) -> List[DataInfo]: """ Get data information items for specific data key Parameters ---------- data_key Returns ------- out List of information for specified key """ return await self._d...
Get data information items for specific data key Parameters ---------- data_key Returns ------- out List of information for specified key
get_infos
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def delete(self, data_key: str, error: str = "raise"): """ Delete object. Parameters ---------- data_key: str object key to delete error: str raise or ignore """ await self._storage_handler_ref.delete(self._session_id, data_k...
Delete object. Parameters ---------- data_key: str object key to delete error: str raise or ignore
delete
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def fetch( self, data_key: Union[str, Tuple], level: StorageLevel = None, band_name: str = None, remote_address: str = None, error: str = "raise", ): """ Fetch object from remote worker or load object from disk. Parameters ------...
Fetch object from remote worker or load object from disk. Parameters ---------- data_key: str or tuple data key(tuple when is shuffle key) to fetch to current worker with specific level. level: StorageLevel the storage level to put into, MEMO...
fetch
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def unpin(self, data_key: str, error: str = "raise"): """ Unpin the data, allow storage to release the data. Parameters ---------- data_key: str data key to unpin error: str raise or ignore """ await self._storage_handler_ref...
Unpin the data, allow storage to release the data. Parameters ---------- data_key: str data key to unpin error: str raise or ignore
unpin
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def open_reader(self, data_key: str) -> StorageFileObject: """ Return a file-like object for reading. Parameters ---------- data_key: str data key Returns ------- return a file-like object. """ return await self._sto...
Return a file-like object for reading. Parameters ---------- data_key: str data key Returns ------- return a file-like object.
open_reader
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def open_writer( self, data_key: Union[Tuple, str], size: int, level: StorageLevel = None ) -> WrappedStorageFileObject: """ Return a file-like object for writing data. Parameters ---------- data_key: str or tuple data key size: int ...
Return a file-like object for writing data. Parameters ---------- data_key: str or tuple data key size: int the total size of data level: StorageLevel the storage level to write Returns ------- return a fi...
open_writer
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def list(self, level: StorageLevel) -> List: """ List all stored data_keys in storage. Parameters ---------- level: StorageLevel the storage level to list all objects Returns ------- list of data keys """ return awai...
List all stored data_keys in storage. Parameters ---------- level: StorageLevel the storage level to list all objects Returns ------- list of data keys
list
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def get_storage_level_info(self, level: StorageLevel) -> StorageInfo: """ Get storage level's info. Parameters ---------- level : StorageLevel Storage level. Returns ------- storage_level_info : StorageInfo """ return aw...
Get storage level's info. Parameters ---------- level : StorageLevel Storage level. Returns ------- storage_level_info : StorageInfo
get_storage_level_info
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def get_storage_info(self, level: StorageLevel) -> dict: """ Get the customized storage backend info of requested storage backend. Parameters ---------- level: StorageLevel the storage level to fetch the backend info. Returns ------- in...
Get the customized storage backend info of requested storage backend. Parameters ---------- level: StorageLevel the storage level to fetch the backend info. Returns ------- info : dict Customized storage backend info dict.
get_storage_info
python
mars-project/mars
mars/services/storage/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/storage/api/oscar.py
Apache-2.0
async def run_subtask_in_slot(self, band_name: str, slot_id: int, subtask: Subtask): """ Run subtask in current worker Parameters ---------- band_name subtask slot_id Returns ------- """ ref = await self._get_runner_ref(band_name...
Run subtask in current worker Parameters ---------- band_name subtask slot_id Returns -------
run_subtask_in_slot
python
mars-project/mars
mars/services/subtask/api.py
https://github.com/mars-project/mars/blob/master/mars/services/subtask/api.py
Apache-2.0
async def cancel_subtask_in_slot(self, band_name: str, slot_id: int): """ Cancel subtask running in a worker slot and wait until it is cancelled Parameters ---------- band_name : str name of a worker band, for instance, 'numa-0' slot_id : int inde...
Cancel subtask running in a worker slot and wait until it is cancelled Parameters ---------- band_name : str name of a worker band, for instance, 'numa-0' slot_id : int index of a slot in a band
cancel_subtask_in_slot
python
mars-project/mars
mars/services/subtask/api.py
https://github.com/mars-project/mars/blob/master/mars/services/subtask/api.py
Apache-2.0
def iter_input_data_keys( subtask: Subtask, chunk_graph: ChunkGraph, chunk_key_to_data_keys: Dict[str, List[str]], ) -> Iterator[Tuple[str, bool]]: """An iterator yield (input data key, is shuffle).""" data_keys = set() for chunk in chunk_graph.iter_indep(): if isinstance(chunk.op, Fetch...
An iterator yield (input data key, is shuffle).
iter_input_data_keys
python
mars-project/mars
mars/services/subtask/utils.py
https://github.com/mars-project/mars/blob/master/mars/services/subtask/utils.py
Apache-2.0
def get_mapper_data_keys(key: str, context: Dict[str, Any]) -> List[str]: """Get the mapper data keys of key from context.""" return [ store_key for store_key in context if isinstance(store_key, tuple) and store_key[0] == key ]
Get the mapper data keys of key from context.
get_mapper_data_keys
python
mars-project/mars
mars/services/subtask/utils.py
https://github.com/mars-project/mars/blob/master/mars/services/subtask/utils.py
Apache-2.0
def iter_output_data( chunk_graph: ChunkGraph, context: Dict[str, Any] ) -> Iterator[Tuple[str, Any, bool]]: """An iterator yield (output chunk key, output data, is shuffle).""" data_keys = set() for result_chunk in chunk_graph.result_chunks: # skip virtual operands for result chunks if ...
An iterator yield (output chunk key, output data, is shuffle).
iter_output_data
python
mars-project/mars
mars/services/subtask/utils.py
https://github.com/mars-project/mars/blob/master/mars/services/subtask/utils.py
Apache-2.0
def gen_subtask_graph( self, op_to_bands: Dict[str, BandType] = None ) -> SubtaskGraph: """ Analyze chunk graph and generate subtask graph. Returns ------- subtask_graph: SubtaskGraph Subtask graph. """ # reassign worker when specified rea...
Analyze chunk graph and generate subtask graph. Returns ------- subtask_graph: SubtaskGraph Subtask graph.
gen_subtask_graph
python
mars-project/mars
mars/services/task/analyzer/analyzer.py
https://github.com/mars-project/mars/blob/master/mars/services/task/analyzer/analyzer.py
Apache-2.0
def assign(self, cur_assigns: Dict[str, str] = None) -> Dict[ChunkData, BandType]: """ Assign start nodes to bands. cur_assigns : dict op already assigned. Returns ------- node_to_bands : dict From node to band. """
Assign start nodes to bands. cur_assigns : dict op already assigned. Returns ------- node_to_bands : dict From node to band.
assign
python
mars-project/mars
mars/services/task/analyzer/assigner.py
https://github.com/mars-project/mars/blob/master/mars/services/task/analyzer/assigner.py
Apache-2.0
async def get_task_results(self, progress: bool = False) -> List[TaskResult]: """ Get results of all tasks in the session Parameters ---------- progress : bool If True, will return task progress Returns ------- task_results: List[TaskResult] ...
Get results of all tasks in the session Parameters ---------- progress : bool If True, will return task progress Returns ------- task_results: List[TaskResult] List of task results
get_task_results
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def wait_task(self, task_id: str, timeout: float = None): """ Wait for a task to finish. Parameters ---------- task_id : str Task ID timeout: float Second to timeout """
Wait for a task to finish. Parameters ---------- task_id : str Task ID timeout: float Second to timeout
wait_task
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def cancel_task(self, task_id: str): """ Cancel task. Parameters ---------- task_id : str Task ID. """
Cancel task. Parameters ---------- task_id : str Task ID.
cancel_task
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def get_task_result(self, task_id: str) -> TaskResult: """ Get task status. Parameters ---------- task_id : str Task ID. Returns ------- result : TaskResult Task result. """
Get task status. Parameters ---------- task_id : str Task ID. Returns ------- result : TaskResult Task result.
get_task_result
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def get_task_progress(self, task_id: str) -> float: """ Get task progress. Parameters ---------- task_id : str Task ID. Returns ------- progress : float Get task progress. """
Get task progress. Parameters ---------- task_id : str Task ID. Returns ------- progress : float Get task progress.
get_task_progress
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def get_fetch_tileables(self, task_id: str) -> List[Tileable]: """ Get fetch tileable for a task. Parameters ---------- task_id : str Task ID. Returns ------- fetch_tileable_list Fetch tileable list. """
Get fetch tileable for a task. Parameters ---------- task_id : str Task ID. Returns ------- fetch_tileable_list Fetch tileable list.
get_fetch_tileables
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def get_last_idle_time(self) -> Union[float, None]: """ Get last idle time from task manager. Returns ------- last_idle_time: float The last idle time if the task manager is idle else None. """
Get last idle time from task manager. Returns ------- last_idle_time: float The last idle time if the task manager is idle else None.
get_last_idle_time
python
mars-project/mars
mars/services/task/api/core.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/core.py
Apache-2.0
async def create(cls, session_id: str, address: str) -> "TaskAPI": """ Create Task API. Parameters ---------- session_id : str Session ID address : str Supervisor address. Returns ------- task_api Task API. ...
Create Task API. Parameters ---------- session_id : str Session ID address : str Supervisor address. Returns ------- task_api Task API.
create
python
mars-project/mars
mars/services/task/api/oscar.py
https://github.com/mars-project/mars/blob/master/mars/services/task/api/oscar.py
Apache-2.0
def from_config(cls, config: Dict, backend: str = None) -> "ExecutionConfig": """Construct an execution config instance from config.""" execution_config = config["task"]["execution_config"] return cls.from_execution_config(execution_config, backend)
Construct an execution config instance from config.
from_config
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
def from_execution_config( cls, execution_config: Union[Dict, "ExecutionConfig"], backend: str = None ) -> "ExecutionConfig": """Construct an execution config instance from execution config.""" if isinstance(execution_config, ExecutionConfig): assert backend is None r...
Construct an execution config instance from execution config.
from_execution_config
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
def from_params( cls, backend: str, n_worker: int, n_cpu: int, mem_bytes: int = 0, cuda_devices: List[List[int]] = None, **kwargs, ) -> "ExecutionConfig": """Construct an execution config instance from params.""" execution_config = { ...
Construct an execution config instance from params.
from_params
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
async def __aenter__(self): """Called when begin to execute the task."""
Called when begin to execute the task.
__aenter__
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
async def execute_subtask_graph( self, stage_id: str, subtask_graph: SubtaskGraph, chunk_graph: ChunkGraph, tile_context: TileContext, context: Any = None, ) -> Dict[Chunk, ExecutionChunkResult]: """Execute a subtask graph and returns result."""
Execute a subtask graph and returns result.
execute_subtask_graph
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
async def append(self, chunk_key: str, chunk_meta: Dict, conditions: List = None): """Append chunk key and related infos."""
Append chunk key and related infos.
append
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
async def get(self): """Get all the data of appended chunk keys."""
Get all the data of appended chunk keys.
get
python
mars-project/mars
mars/services/task/execution/api.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/api.py
Apache-2.0
def get_monitor_interval_seconds(self): """ The interval seconds for the monitor task to update progress and collect garbage. """ return self._ray_execution_config.get( "monitor_interval_seconds", DEFAULT_MONITOR_INTERVAL_SECONDS )
The interval seconds for the monitor task to update progress and collect garbage.
get_monitor_interval_seconds
python
mars-project/mars
mars/services/task/execution/ray/config.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/config.py
Apache-2.0
def execute_subtask( subtask_id: str, subtask_chunk_graph: ChunkGraph, output_meta_n_keys: int, is_mapper, *inputs, ): """ The function used for execute subtask in ray task. Parameters ---------- subtask_id: str id of subtask subtask_chunk_graph: ChunkGraph c...
The function used for execute subtask in ray task. Parameters ---------- subtask_id: str id of subtask subtask_chunk_graph: ChunkGraph chunk graph for subtask output_meta_n_keys: int will be 0 if subtask is a shuffle mapper. is_mapper: bool Whether current s...
execute_subtask
python
mars-project/mars
mars/services/task/execution/ray/executor.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/executor.py
Apache-2.0
async def _load_subtask_inputs( self, stage_id: str, subtask: Subtask, context: Dict, shuffle_manager: ShuffleManager, ): """ Load input object refs of subtask from context. It updates the context if the input object refs are fetched from the ...
Load input object refs of subtask from context. It updates the context if the input object refs are fetched from the meta service.
_load_subtask_inputs
python
mars-project/mars
mars/services/task/execution/ray/executor.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/executor.py
Apache-2.0
def add_mapper_output_refs( self, subtask: Subtask, output_object_refs: List["ray.ObjectRef"] ): """ Record mapper output ObjectRefs which will be used by reducers later. Parameters ---------- subtask output_object_refs : List["ray.ObjectRef"] Map...
Record mapper output ObjectRefs which will be used by reducers later. Parameters ---------- subtask output_object_refs : List["ray.ObjectRef"] Mapper output ObjectRefs.
add_mapper_output_refs
python
mars-project/mars
mars/services/task/execution/ray/shuffle.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/shuffle.py
Apache-2.0
def get_reducer_input_refs(self, subtask: Subtask) -> List["ray.ObjectRef"]: """ Get the reducer inputs ObjectRefs output by mappers. Parameters ---------- subtask : Subtask A reducer subtask. Returns ------- input_refs : List["ray.ObjectRef"]...
Get the reducer inputs ObjectRefs output by mappers. Parameters ---------- subtask : Subtask A reducer subtask. Returns ------- input_refs : List["ray.ObjectRef"] The reducer inputs ObjectRefs output by mappers.
get_reducer_input_refs
python
mars-project/mars
mars/services/task/execution/ray/shuffle.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/shuffle.py
Apache-2.0
def get_n_reducers(self, subtask: Subtask): """ Get the number of shuffle blocks that a mapper operand outputs, which is also the number of the reducers when tiling shuffle operands. Note that this might be greater than actual number of the reducers in the subtask graph, because ...
Get the number of shuffle blocks that a mapper operand outputs, which is also the number of the reducers when tiling shuffle operands. Note that this might be greater than actual number of the reducers in the subtask graph, because some reducers may not be added to chunk graph. ...
get_n_reducers
python
mars-project/mars
mars/services/task/execution/ray/shuffle.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/shuffle.py
Apache-2.0
def remove_object_refs(self, subtask: Subtask): """ Set the object refs to None by subtask. """ index = self._mapper_indices.get(subtask) if index is not None: shuffle_index, mapper_index = index self._mapper_output_refs[shuffle_index][mapper_index].fill(N...
Set the object refs to None by subtask.
remove_object_refs
python
mars-project/mars
mars/services/task/execution/ray/shuffle.py
https://github.com/mars-project/mars/blob/master/mars/services/task/execution/ray/shuffle.py
Apache-2.0
def tile(self, tileable_graph: TileableGraph) -> Iterable[ChunkGraph]: """ Generate chunk graphs Returns ------- chunk_graph_generator: Generator Chunk graphs. """ from ....optimization.logical.chunk import optimize as optimize_chunk_graph s...
Generate chunk graphs Returns ------- chunk_graph_generator: Generator Chunk graphs.
tile
python
mars-project/mars
mars/services/task/supervisor/preprocessor.py
https://github.com/mars-project/mars/blob/master/mars/services/task/supervisor/preprocessor.py
Apache-2.0
def _check_shuffle_reduce_chunks(cls, chunks: List, checked_chunks): """Check shuffle reduce chunks sorted reducer_index consistent with reducer_ordinal. So shuffle mapper blocks can be sorted by reducer_index, and the reducer can fetch mapper data by reducer_ordinal. """ chunks = [c for...
Check shuffle reduce chunks sorted reducer_index consistent with reducer_ordinal. So shuffle mapper blocks can be sorted by reducer_index, and the reducer can fetch mapper data by reducer_ordinal.
_check_shuffle_reduce_chunks
python
mars-project/mars
mars/services/task/supervisor/tests/task_preprocessor.py
https://github.com/mars-project/mars/blob/master/mars/services/task/supervisor/tests/task_preprocessor.py
Apache-2.0
async def create(cls, session_id, supervisor_address): """ Create the fault injection manager on supervisor. Parameters ---------- session_id The session id. supervisor_address The supervisor address. ------- """ session_ap...
Create the fault injection manager on supervisor. Parameters ---------- session_id The session id. supervisor_address The supervisor address. -------
create
python
mars-project/mars
mars/services/tests/fault_injection_manager.py
https://github.com/mars-project/mars/blob/master/mars/services/tests/fault_injection_manager.py
Apache-2.0
async def setup(cls, **kwargs) -> Tuple[Dict, Dict]: """ Setup environments, for example, start plasma store for plasma backend. Parameters ---------- kwargs : kwargs Kwargs for setup. Returns ------- Tuple of two dicts Dicts for ...
Setup environments, for example, start plasma store for plasma backend. Parameters ---------- kwargs : kwargs Kwargs for setup. Returns ------- Tuple of two dicts Dicts for initialization and teardown.
setup
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def teardown(**kwargs): """ Clean up the environments. Parameters ---------- kwargs : kwargs Parameters for clean up. """
Clean up the environments. Parameters ---------- kwargs : kwargs Parameters for clean up.
teardown
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
def level(self) -> StorageLevel: """ Level of current storage backend. Returns ------- Level: StorageLevel storage level. """
Level of current storage backend. Returns ------- Level: StorageLevel storage level.
level
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def get(self, object_id, **kwargs) -> object: """ Get object by key. For some backends, `columns` or `slice` can pass to get part of data. Parameters ---------- object_id : object id Object id to get. kwargs: Additional keyword arguments ...
Get object by key. For some backends, `columns` or `slice` can pass to get part of data. Parameters ---------- object_id : object id Object id to get. kwargs: Additional keyword arguments Returns ------- Python object
get
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def put(self, obj, importance: int = 0) -> ObjectInfo: """ Put object into storage with object_id. Parameters ---------- obj : python object Object to put. importance: int The priority to spill when storage is full Returns ...
Put object into storage with object_id. Parameters ---------- obj : python object Object to put. importance: int The priority to spill when storage is full Returns ------- ObjectInfo object information including siz...
put
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def delete(self, object_id): """ Delete object from storage by object_id. Parameters ---------- object_id object id """
Delete object from storage by object_id. Parameters ---------- object_id object id
delete
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def object_info(self, object_id) -> ObjectInfo: """ Get information about stored object. Parameters ---------- object_id object id Returns ------- ObjectInfo Object info including size, device and etc. """
Get information about stored object. Parameters ---------- object_id object id Returns ------- ObjectInfo Object info including size, device and etc.
object_info
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def open_writer(self, size=None) -> StorageFileObject: """ Return a file-like object for writing. Parameters ---------- size: int Maximum size in bytes Returns ------- fileobj: StorageFileObject """
Return a file-like object for writing. Parameters ---------- size: int Maximum size in bytes Returns ------- fileobj: StorageFileObject
open_writer
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def open_reader(self, object_id) -> StorageFileObject: """ Return a file-like object for reading. Parameters ---------- object_id Object id Returns ------- fileobj: StorageFileObject """
Return a file-like object for reading. Parameters ---------- object_id Object id Returns ------- fileobj: StorageFileObject
open_reader
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def list(self) -> List: """ List all stored objects in storage. Returns ------- List of objects """
List all stored objects in storage. Returns ------- List of objects
list
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def fetch(self, object_id): """ Fetch object to current worker. Parameters ---------- object_id Object id. """
Fetch object to current worker. Parameters ---------- object_id Object id.
fetch
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def pin(self, object_id): """ Pin the data to prevent the data being released or spilled. Parameters ---------- object_id object id """
Pin the data to prevent the data being released or spilled. Parameters ---------- object_id object id
pin
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
async def unpin(self, object_id): """ Unpin the data, allow storage to release the data. Parameters ---------- object_id object id """
Unpin the data, allow storage to release the data. Parameters ---------- object_id object id
unpin
python
mars-project/mars
mars/storage/base.py
https://github.com/mars-project/mars/blob/master/mars/storage/base.py
Apache-2.0
def get_actual_capacity(plasma_client: "plasma.PlasmaClient") -> int: """ Get actual capacity of plasma store Parameters ---------- plasma_client: PlasmaClient Plasma client. Returns ------- size: int Actual storage size in bytes """ store_limit = plasma_client....
Get actual capacity of plasma store Parameters ---------- plasma_client: PlasmaClient Plasma client. Returns ------- size: int Actual storage size in bytes
get_actual_capacity
python
mars-project/mars
mars/storage/plasma.py
https://github.com/mars-project/mars/blob/master/mars/storage/plasma.py
Apache-2.0
def sort(self, axis=-1, kind=None, parallel_kind=None, psrs_kinds=None, order=None): """ Sort a tensor, in-place. Parameters ---------- axis : int, optional Axis along which to sort. Default is -1, which means sort along the last axis. kind : {'qu...
Sort a tensor, in-place. Parameters ---------- axis : int, optional Axis along which to sort. Default is -1, which means sort along the last axis. kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional Sorting algorithm. Default is...
sort
python
mars-project/mars
mars/tensor/core.py
https://github.com/mars-project/mars/blob/master/mars/tensor/core.py
Apache-2.0
def partition(self, kth, axis=-1, kind="introselect", order=None, **kw): """ Rearranges the elements in the tensor in such a way that the value of the element in kth position is in the position it would be in a sorted tensor. All elements smaller than the kth element are moved before thi...
Rearranges the elements in the tensor in such a way that the value of the element in kth position is in the position it would be in a sorted tensor. All elements smaller than the kth element are moved before this element and all equal or greater are moved behind it. The ordering of the ...
partition
python
mars-project/mars
mars/tensor/core.py
https://github.com/mars-project/mars/blob/master/mars/tensor/core.py
Apache-2.0
def normalize_axis_tuple(axis, ndim, argname=None, allow_duplicate=False): """ Normalizes an axis argument into a tuple of non-negative integer axes. This handles shorthands such as ``1`` and converts them to ``(1,)``, as well as performing the handling of negative indices covered by `normalize_axi...
Normalizes an axis argument into a tuple of non-negative integer axes. This handles shorthands such as ``1`` and converts them to ``(1,)``, as well as performing the handling of negative indices covered by `normalize_axis_index`. By default, this forbids axes from being specified multiple times. ...
normalize_axis_tuple
python
mars-project/mars
mars/tensor/utils.py
https://github.com/mars-project/mars/blob/master/mars/tensor/utils.py
Apache-2.0
def dictify_chunk_size(shape, chunk_size): """ Given chunk_size which may be a tuple or dict, return a dict type all the same. :param shape: tensor's shape :param chunk_size: if dict provided, it's dimension id to chunk size; if provided, it's the chunk size for each dimension. ...
Given chunk_size which may be a tuple or dict, return a dict type all the same. :param shape: tensor's shape :param chunk_size: if dict provided, it's dimension id to chunk size; if provided, it's the chunk size for each dimension. :return: dict form of chunk_size
dictify_chunk_size
python
mars-project/mars
mars/tensor/utils.py
https://github.com/mars-project/mars/blob/master/mars/tensor/utils.py
Apache-2.0
def decide_chunk_sizes(shape, chunk_size, itemsize): """ Decide how a given tensor can be split into chunk. :param shape: tensor's shape :param chunk_size: if dict provided, it's dimension id to chunk size; if provided, it's the chunk size for each dimension. :param itemsize:...
Decide how a given tensor can be split into chunk. :param shape: tensor's shape :param chunk_size: if dict provided, it's dimension id to chunk size; if provided, it's the chunk size for each dimension. :param itemsize: element size :return: the calculated chunk size for eac...
decide_chunk_sizes
python
mars-project/mars
mars/tensor/utils.py
https://github.com/mars-project/mars/blob/master/mars/tensor/utils.py
Apache-2.0
def check_random_state(seed): """ Turn seed into a mt.random.RandomState instance :param seed: If seed is None, return the RandomState singleton used by mt.random. If seed is an int, return a new RandomState instance seeded with seed. If seed is already a RandomState instance, retur...
Turn seed into a mt.random.RandomState instance :param seed: If seed is None, return the RandomState singleton used by mt.random. If seed is an int, return a new RandomState instance seeded with seed. If seed is already a RandomState instance, return it. Otherwise raise ValueEr...
check_random_state
python
mars-project/mars
mars/tensor/utils.py
https://github.com/mars-project/mars/blob/master/mars/tensor/utils.py
Apache-2.0
def abs(x, out=None, where=None, **kwargs): r""" Calculate the absolute value element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Calculate the absolute value element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provide...
abs
python
mars-project/mars
mars/tensor/arithmetic/abs.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/abs.py
Apache-2.0
def absolute(x, out=None, where=None, **kwargs): r""" Calculate the absolute value element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Calculate the absolute value element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provide...
absolute
python
mars-project/mars
mars/tensor/arithmetic/absolute.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/absolute.py
Apache-2.0
def add(x1, x2, out=None, where=None, **kwargs): """ Add arguments element-wise. Parameters ---------- x1, x2 : array_like The tensors to be added. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which may be the shape of one or the other). ou...
Add arguments element-wise. Parameters ---------- x1, x2 : array_like The tensors to be added. If ``x1.shape != x2.shape``, they must be broadcastable to a common shape (which may be the shape of one or the other). out : Tensor, None, or tuple of Tensor and None, optional ...
add
python
mars-project/mars
mars/tensor/arithmetic/add.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/add.py
Apache-2.0
def arccos(x, out=None, where=None, **kwargs): """ Trigonometric inverse cosine, element-wise. The inverse of `cos` so that, if ``y = cos(x)``, then ``x = arccos(y)``. Parameters ---------- x : array_like `x`-coordinate on the unit circle. For real arguments, the domain is [-1,...
Trigonometric inverse cosine, element-wise. The inverse of `cos` so that, if ``y = cos(x)``, then ``x = arccos(y)``. Parameters ---------- x : array_like `x`-coordinate on the unit circle. For real arguments, the domain is [-1, 1]. out : Tensor, None, or tuple of Tensor and No...
arccos
python
mars-project/mars
mars/tensor/arithmetic/arccos.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arccos.py
Apache-2.0
def arccosh(x, out=None, where=None, **kwargs): """ Inverse hyperbolic cosine, element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Inverse hyperbolic cosine, element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided ...
arccosh
python
mars-project/mars
mars/tensor/arithmetic/arccosh.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arccosh.py
Apache-2.0
def arcsin(x, out=None, where=None, **kwargs): """ Inverse sine, element-wise. Parameters ---------- x : array_like `y`-coordinate on the unit circle. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Inverse sine, element-wise. Parameters ---------- x : array_like `y`-coordinate on the unit circle. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not p...
arcsin
python
mars-project/mars
mars/tensor/arithmetic/arcsin.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arcsin.py
Apache-2.0
def arcsinh(x, out=None, where=None, **kwargs): """ Inverse hyperbolic sine element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a ...
Inverse hyperbolic sine element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or ...
arcsinh
python
mars-project/mars
mars/tensor/arithmetic/arcsinh.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arcsinh.py
Apache-2.0
def arctan(x, out=None, where=None, **kwargs): """ Trigonometric inverse tangent, element-wise. The inverse of tan, so that if ``y = tan(x)`` then ``x = arctan(y)``. Parameters ---------- x : array_like out : Tensor, None, or tuple of Tensor and None, optional A location into which...
Trigonometric inverse tangent, element-wise. The inverse of tan, so that if ``y = tan(x)`` then ``x = arctan(y)``. Parameters ---------- x : array_like out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
arctan
python
mars-project/mars
mars/tensor/arithmetic/arctan.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arctan.py
Apache-2.0
def arctan2(x1, x2, out=None, where=None, **kwargs): """ Element-wise arc tangent of ``x1/x2`` choosing the quadrant correctly. The quadrant (i.e., branch) is chosen so that ``arctan2(x1, x2)`` is the signed angle in radians between the ray ending at the origin and passing through the point (1,0), ...
Element-wise arc tangent of ``x1/x2`` choosing the quadrant correctly. The quadrant (i.e., branch) is chosen so that ``arctan2(x1, x2)`` is the signed angle in radians between the ray ending at the origin and passing through the point (1,0), and the ray ending at the origin and passing through the...
arctan2
python
mars-project/mars
mars/tensor/arithmetic/arctan2.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arctan2.py
Apache-2.0
def arctanh(x, out=None, where=None, **kwargs): """ Inverse hyperbolic tangent element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Inverse hyperbolic tangent element-wise. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided ...
arctanh
python
mars-project/mars
mars/tensor/arithmetic/arctanh.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/arctanh.py
Apache-2.0
def around(a, decimals=0, out=None): """ Evenly round to the given number of decimals. Parameters ---------- a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positi...
Evenly round to the given number of decimals. Parameters ---------- a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positions to the left of the decimal point...
around
python
mars-project/mars
mars/tensor/arithmetic/around.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/around.py
Apache-2.0
def bitand(x1, x2, out=None, where=None, **kwargs): """ Compute the bit-wise AND of two tensors element-wise. Computes the bit-wise AND of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``&``. Parameters ---------- ...
Compute the bit-wise AND of two tensors element-wise. Computes the bit-wise AND of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``&``. Parameters ---------- x1, x2 : array_like Only integer and boolean types ...
bitand
python
mars-project/mars
mars/tensor/arithmetic/bitand.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/bitand.py
Apache-2.0
def bitor(x1, x2, out=None, where=None, **kwargs): """ Compute the bit-wise OR of two tensors element-wise. Computes the bit-wise OR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``|``. Parameters ---------- x1,...
Compute the bit-wise OR of two tensors element-wise. Computes the bit-wise OR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``|``. Parameters ---------- x1, x2 : array_like Only integer and boolean types ar...
bitor
python
mars-project/mars
mars/tensor/arithmetic/bitor.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/bitor.py
Apache-2.0
def bitxor(x1, x2, out=None, where=None, **kwargs): """ Compute the bit-wise XOR of two arrays element-wise. Computes the bit-wise XOR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``^``. Parameters ---------- x...
Compute the bit-wise XOR of two arrays element-wise. Computes the bit-wise XOR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ``^``. Parameters ---------- x1, x2 : array_like Only integer and boolean types a...
bitxor
python
mars-project/mars
mars/tensor/arithmetic/bitxor.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/bitxor.py
Apache-2.0
def cbrt(x, out=None, where=None, **kwargs): """ Return the cube-root of an tensor, element-wise. Parameters ---------- x : array_like The values whose cube-roots are required. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. ...
Return the cube-root of an tensor, element-wise. Parameters ---------- x : array_like The values whose cube-roots are required. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the i...
cbrt
python
mars-project/mars
mars/tensor/arithmetic/cbrt.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/cbrt.py
Apache-2.0
def ceil(x, out=None, where=None, **kwargs): r""" Return the ceiling of the input, element-wise. The ceil of the scalar `x` is the smallest integer `i`, such that `i >= x`. It is often denoted as :math:`\lceil x \rceil`. Parameters ---------- x : array_like Input data. out : T...
Return the ceiling of the input, element-wise. The ceil of the scalar `x` is the smallest integer `i`, such that `i >= x`. It is often denoted as :math:`\lceil x \rceil`. Parameters ---------- x : array_like Input data. out : Tensor, None, or tuple of Tensor and None, optional ...
ceil
python
mars-project/mars
mars/tensor/arithmetic/ceil.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/ceil.py
Apache-2.0
def conj(x, out=None, where=None, **kwargs): """ Return the complex conjugate, element-wise. The complex conjugate of a complex number is obtained by changing the sign of its imaginary part. Parameters ---------- x : array_like Input value. out : Tensor, None, or tuple of Tenso...
Return the complex conjugate, element-wise. The complex conjugate of a complex number is obtained by changing the sign of its imaginary part. Parameters ---------- x : array_like Input value. out : Tensor, None, or tuple of Tensor and None, optional A location into which t...
conj
python
mars-project/mars
mars/tensor/arithmetic/conj.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/conj.py
Apache-2.0
def copysign(x1, x2, out=None, where=None, **kwargs): """ Change the sign of x1 to that of x2, element-wise. If both arguments are arrays or sequences, they have to be of the same length. If `x2` is a scalar, its sign will be copied to all elements of `x1`. Parameters ---------- x1 : a...
Change the sign of x1 to that of x2, element-wise. If both arguments are arrays or sequences, they have to be of the same length. If `x2` is a scalar, its sign will be copied to all elements of `x1`. Parameters ---------- x1 : array_like Values to change the sign of. x2 : arra...
copysign
python
mars-project/mars
mars/tensor/arithmetic/copysign.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/copysign.py
Apache-2.0
def cos(x, out=None, where=None, **kwargs): """ Cosine element-wise. Parameters ---------- x : array_like Input tensor in radians. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that...
Cosine element-wise. Parameters ---------- x : array_like Input tensor in radians. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or `None`...
cos
python
mars-project/mars
mars/tensor/arithmetic/cos.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/cos.py
Apache-2.0
def cosh(x, out=None, where=None, **kwargs): """ Hyperbolic cosine, element-wise. Equivalent to ``1/2 * (mt.exp(x) + mt.exp(-x))`` and ``mt.cos(1j*x)``. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location i...
Hyperbolic cosine, element-wise. Equivalent to ``1/2 * (mt.exp(x) + mt.exp(-x))`` and ``mt.cos(1j*x)``. Parameters ---------- x : array_like Input tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must...
cosh
python
mars-project/mars
mars/tensor/arithmetic/cosh.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/cosh.py
Apache-2.0
def deg2rad(x, out=None, where=None, **kwargs): """ Convert angles from degrees to radians. Parameters ---------- x : array_like Angles in degrees. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have ...
Convert angles from degrees to radians. Parameters ---------- x : array_like Angles in degrees. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provi...
deg2rad
python
mars-project/mars
mars/tensor/arithmetic/deg2rad.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/deg2rad.py
Apache-2.0
def degrees(x, out=None, where=None, **kwargs): """ Convert angles from radians to degrees. Parameters ---------- x : array_like Input tensor in radians. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must ha...
Convert angles from radians to degrees. Parameters ---------- x : array_like Input tensor in radians. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not...
degrees
python
mars-project/mars
mars/tensor/arithmetic/degrees.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/degrees.py
Apache-2.0
def divide(x1, x2, out=None, where=None, **kwargs): """ Divide arguments element-wise. Parameters ---------- x1 : array_like Dividend tensor. x2 : array_like Divisor tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is...
Divide arguments element-wise. Parameters ---------- x1 : array_like Dividend tensor. x2 : array_like Divisor tensor. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the...
divide
python
mars-project/mars
mars/tensor/arithmetic/divide.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/divide.py
Apache-2.0
def equal(x1, x2, out=None, where=None, **kwargs): """ Return (x1 == x2) element-wise. Parameters ---------- x1, x2 : array_like Input tensors of the same shape. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it...
Return (x1 == x2) element-wise. Parameters ---------- x1, x2 : array_like Input tensors of the same shape. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. I...
equal
python
mars-project/mars
mars/tensor/arithmetic/equal.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/equal.py
Apache-2.0
def exp(x, out=None, where=None, **kwargs): r""" Calculate the exponential of all elements in the input tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, i...
Calculate the exponential of all elements in the input tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcas...
exp
python
mars-project/mars
mars/tensor/arithmetic/exp.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/exp.py
Apache-2.0
def exp2(x, out=None, where=None, **kwargs): """ Calculate `2**p` for all `p` in the input tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of tensor and None, optional A location into which the result is stored. If provided, it must have ...
Calculate `2**p` for all `p` in the input tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not ...
exp2
python
mars-project/mars
mars/tensor/arithmetic/exp2.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/exp2.py
Apache-2.0
def expm1(x, out=None, where=None, **kwargs): """ Calculate ``exp(x) - 1`` for all elements in the tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must...
Calculate ``exp(x) - 1`` for all elements in the tensor. Parameters ---------- x : array_like Input values. out : Tensor, None, or tuple of Tensor and None, optional A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. I...
expm1
python
mars-project/mars
mars/tensor/arithmetic/expm1.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/expm1.py
Apache-2.0
def fabs(x, out=None, where=None, **kwargs): """ Compute the absolute values element-wise. This function returns the absolute values (positive magnitude) of the data in `x`. Complex values are not handled, use `absolute` to find the absolute values of complex data. Parameters ---------- ...
Compute the absolute values element-wise. This function returns the absolute values (positive magnitude) of the data in `x`. Complex values are not handled, use `absolute` to find the absolute values of complex data. Parameters ---------- x : array_like The tensor of numbers for w...
fabs
python
mars-project/mars
mars/tensor/arithmetic/fabs.py
https://github.com/mars-project/mars/blob/master/mars/tensor/arithmetic/fabs.py
Apache-2.0