먼저 오늘도 고생 많으셨습니다.
오늘 들으신 내용은 거의 모든 언어에서 처음 배우기 마련인 출력에 대한 함수입니다.
파이썬에서는 대표적으로 print
를 배우게 되는데요. 이 print
라는 함수에 대해 보다 심화된 내용을 소개드리려고 합니다.
먼저 시작에 앞서 다음과 같이 입력해보겠습니다.
help(print)
#!/usr/bin/env ruby | |
# | |
# JavaScript Soundfont Builder for MIDI.js | |
# Author: 0xFE <[email protected]> | |
# edited by Valentijn Nieman <[email protected]> | |
# | |
# Requires: | |
# | |
# FluidSynth | |
# Lame |
// Copyright 2019 The MediaPipe Authors. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
먼저 오늘도 고생 많으셨습니다.
오늘 들으신 내용은 거의 모든 언어에서 처음 배우기 마련인 출력에 대한 함수입니다.
파이썬에서는 대표적으로 print
를 배우게 되는데요. 이 print
라는 함수에 대해 보다 심화된 내용을 소개드리려고 합니다.
먼저 시작에 앞서 다음과 같이 입력해보겠습니다.
help(print)
import functools | |
def my_collate(batch, use_shared_memory=False): | |
r"""Puts each data field into a tensor with outer dimension batch size""" | |
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}" | |
elem_type = type(batch[0]) | |
if isinstance(batch[0], torch.Tensor): | |
out = None | |
if use_shared_memory: |
import functools | |
def my_collate(batch, use_shared_memory=False): | |
r"""Puts each data field into a tensor with outer dimension batch size""" | |
error_msg = "batch must contain tensors, numbers, dicts or lists; found {}" | |
elem_type = type(batch[0]) | |
if isinstance(batch[0], torch.Tensor): | |
out = None | |
if use_shared_memory: |
from torch import * | |
import torch.nn.functional as F | |
import torch.nn as nn | |
class RNNModel(nn.Module): | |
""" | |
Neural Network Module with an embedding layer, a recurent module and an output linear layer | |
Arguments: | |
rnn_type(str) -- type of rnn module to use options are ['LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU'] |
A convolution operator over a 1D tensor (BxCxL), where a list of neighbors for each element is provided through a indices tensor (LxK), where K is the size of the convolution kernel. Each row of indices specifies the indices of the K neighbors of the corresponding element in the input. A -1 is handled like for zero padding.
Note that the neighbors specified in indices are not relative, but rather absolute. They have to be specified for each of the elements of the output.
A use case is for convolutions over non-square lattices, such as images on hexagonal lattices coming from Cherenkov telescopes (http://www.isdc.unige.ch/%7Elyard/FirstLight/FirstLight_slowHD.mov).
Example:
function link_fbx_sdk() { | |
INTERPRETER=$1 | |
SITE_PACKAGES=`$INTERPRETER -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` | |
PYTHON_LIB="${2}" | |
echo "[Installing] '$PYTHON_LIB' to '$SITE_PACKAGES'" | |
pushd $SITE_PACKAGES | |
for file in "${PYTHON_LIB}"/* | |
do |